From f4a48e46ffa89d0e56de0f6894933c646ea0689d Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 16:54:31 +0200 Subject: [PATCH] add: quick link categories to user --- htdocs/categories/viewcat.php | 26 +++++++++++++++++++++++++- htdocs/langs/fr_FR/categories.lang | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) 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 '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print $langs->trans("AddProjectIntoCategory").'  '; + $form->select_users('', 'elemid'); + print '
'; + print '
'; + } print '
'; print ''; print ''; diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 0868802298e..36b96f8ffae 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -91,6 +91,7 @@ AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client AddMemberIntoCategory=Assigner cette catégorie au membre AddContactIntoCategory=Assigner cette catégorie au contact +AddUserIntoCategory=Assigner cette catégorie à l'utilisateur AddProjectIntoCategory=Assigner cette catégorie au projet AddTicketIntoCategory=Assigner cette catégorie au ticket AddSupplierIntoCategory=Assigner cette catégorie au fournisseur