diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 727ef8b0610..c7242077da4 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -4,6 +4,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Raphaƫl Doursenaud + * Copyright (C) 2020 Tobias Sekan * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -290,8 +291,18 @@ if ($user->rights->categorie->supprimer) print ""; +if (! empty($user->rights->categorie->creer)) +{ + $link = DOL_URL_ROOT.'/categories/card.php'; + $link .= '?action=create'; + $link .= '&type='.$type; + $link .= '&catorigin='.$object->id; + $link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id); - + print '
'; + print dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', $link); + print "
"; +} $cats = $object->get_filles(); if ($cats < 0)