add: quick link categories to account
This commit is contained in:
parent
f4a48e46ff
commit
03030685f6
@ -177,7 +177,8 @@ if ($elemid && $action == 'addintocategory' &&
|
|||||||
($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) ||
|
($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) ||
|
||||||
($type == Categorie::TYPE_MEMBER && $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)
|
($type == Categorie::TYPE_USER && $user->rights->user->user->creer) ||
|
||||||
|
($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
|
||||||
)) {
|
)) {
|
||||||
if ($type == Categorie::TYPE_PRODUCT) {
|
if ($type == Categorie::TYPE_PRODUCT) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
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';
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
$newobject = new User($db);
|
$newobject = new User($db);
|
||||||
$elementtype = 'user';
|
$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);
|
$result = $newobject->fetch($elemid);
|
||||||
|
|
||||||
@ -558,6 +563,7 @@ if ($type == Categorie::TYPE_PRODUCT) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of customers
|
||||||
if ($type == Categorie::TYPE_CUSTOMER) {
|
if ($type == Categorie::TYPE_CUSTOMER) {
|
||||||
$permission = $user->rights->societe->creer;
|
$permission = $user->rights->societe->creer;
|
||||||
|
|
||||||
@ -631,7 +637,7 @@ if ($type == Categorie::TYPE_CUSTOMER) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of suppliers
|
||||||
if ($type == Categorie::TYPE_SUPPLIER) {
|
if ($type == Categorie::TYPE_SUPPLIER) {
|
||||||
$permission = $user->rights->societe->creer;
|
$permission = $user->rights->societe->creer;
|
||||||
|
|
||||||
@ -876,6 +882,26 @@ if ($type == Categorie::TYPE_ACCOUNT) {
|
|||||||
if ($accounts < 0) {
|
if ($accounts < 0) {
|
||||||
dol_print_error($db, $object->error, $object->errors);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
} else {
|
} else {
|
||||||
|
// Form to add record into a category
|
||||||
|
$showclassifyform = 1;
|
||||||
|
if ($showclassifyform) {
|
||||||
|
print '<br>';
|
||||||
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||||
|
print '<input type="hidden" name="type" value="'.$typeid.'">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
|
print '<input type="hidden" name="action" value="addintocategory">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre"><td>';
|
||||||
|
print $langs->trans("AddAccountIntoCategory").' ';
|
||||||
|
$form->select_comptes('', 'elemid');
|
||||||
|
print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
print '</table>';
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||||
|
|||||||
@ -93,6 +93,7 @@ AddMemberIntoCategory=Assigner cette catégorie au membre
|
|||||||
AddContactIntoCategory=Assigner cette catégorie au contact
|
AddContactIntoCategory=Assigner cette catégorie au contact
|
||||||
AddUserIntoCategory=Assigner cette catégorie à l'utilisateur
|
AddUserIntoCategory=Assigner cette catégorie à l'utilisateur
|
||||||
AddProjectIntoCategory=Assigner cette catégorie au projet
|
AddProjectIntoCategory=Assigner cette catégorie au projet
|
||||||
|
AddAccountIntoCategory=Assigner cette catégorie au compte
|
||||||
AddTicketIntoCategory=Assigner cette catégorie au ticket
|
AddTicketIntoCategory=Assigner cette catégorie au ticket
|
||||||
AddSupplierIntoCategory=Assigner cette catégorie au fournisseur
|
AddSupplierIntoCategory=Assigner cette catégorie au fournisseur
|
||||||
ShowCategory=Afficher tag/catégorie
|
ShowCategory=Afficher tag/catégorie
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user