Organigramme de poste
[auf_rh_dae.git] / project / menu.py
index 3fc7c83..1a1ab8e 100644 (file)
@@ -12,7 +12,7 @@ from django.core.urlresolvers import reverse
 from django.utils.translation import ugettext_lazy as _
 
 from admin_tools.menu import items, Menu
-
+from project.rh.groups import grp_drh
 
 class CustomMenu(Menu):
     """
@@ -27,13 +27,6 @@ class CustomMenu(Menu):
                 _('Applications'),
                 exclude=('django.contrib.*',)
             ),
-            items.MenuItem('Rapports',
-                           children=[
-                               items.MenuItem('Rapport des postes', reverse('rhr_postes')),
-                               items.MenuItem('Rapport des contrats', reverse('rhr_contrats')),
-                               items.MenuItem('Rapport de rémunération', reverse('rhr_remuneration')),
-                           ]
-                          ),
             items.AppList(
                 _('Administration'),
                 models=('django.contrib.*',)
@@ -44,4 +37,25 @@ class CustomMenu(Menu):
         """
         Use this method if you need to access the request context.
         """
-        return super(CustomMenu, self).init_with_context(context)
+        request = context['request']
+        if grp_drh in request.user.groups.all() or request.user.is_superuser:
+            self.children += [
+                items.MenuItem('Rapports',
+                               children=[
+                                   #items.MenuItem('Rapport des postes', reverse('rhr_postes')),
+                                   items.MenuItem('Rapport des contrats', reverse('rhr_contrats')),
+                                   items.MenuItem(u'Rapport des employés sans contrat', reverse('rhr_employe_sans_contrat')),
+                                   #items.MenuItem('Rapport de rémunération', reverse('rhr_remuneration')),
+                                   items.MenuItem('Rapport des postes par service', reverse('rhr_postes_service')),
+                                   items.MenuItem('Rapport des postes par implantation', reverse('rhr_postes_implantation')),
+                                   items.MenuItem('Modelisation des postes', reverse('rhr_postes_modelisation')),
+                                   #items.MenuItem('Rapport hiérarchique des postes', reverse('rhr_postes_hierarchie')),
+                               ]
+                              ),
+                items.MenuItem('Organigrammes',
+                    children=[
+                        ]
+                    ),
+            ]
+        super(CustomMenu, self).init_with_context(context)
+