Rapport de modelisation des postes WIP
authorJean-Philippe Caissy <jpcaissy@piji.ca>
Thu, 16 Feb 2012 22:09:42 +0000 (16:09 -0600)
committerJean-Philippe Caissy <jpcaissy@piji.ca>
Thu, 16 Feb 2012 22:09:42 +0000 (16:09 -0600)
project/menu.py
project/rh/templates/rh/rapports/postes_modelisation.html [new file with mode: 0644]
project/rh/urls.py
project/rh/views.py

index ee79a23..9428130 100644 (file)
@@ -46,7 +46,8 @@ class CustomMenu(Menu):
                                    items.MenuItem('Rapport des contrats', reverse('rhr_contrats')),
                                    #items.MenuItem('Rapport de rémunération', reverse('rhr_remuneration')),
                                    items.MenuItem('Rapport des postes par service', reverse('rhr_postes_service')),
-                                   items.MenuItem('Rappor des postes par implantation', reverse('rhr_postes_implantation')),
+                                   items.MenuItem('Rapport des postes par implantation', reverse('rhr_postes_implantation')),
+                                   items.MenuItem('Modelisation des postes', reverse('rhr_postes_modelisation')),
                                ]
                               ),
             ]
diff --git a/project/rh/templates/rh/rapports/postes_modelisation.html b/project/rh/templates/rh/rapports/postes_modelisation.html
new file mode 100644 (file)
index 0000000..dbd30ee
--- /dev/null
@@ -0,0 +1,25 @@
+{% extends 'rh/rapports/base.html' %}
+{% load adminmedia rapports i18n %}
+
+{% block nomrapport %}Rapport postes par implantation{% endblock %}
+{% block count_elements %}{% endblock %}
+
+{% block contentrapport %}
+<ul>
+    {% for d in data %}
+        <li>{{ d.region.nom }}
+            <ul>
+                {% for i in d.implantations %}
+                    <li> {{ i.implantation.nom }} ({{ i.num_postes }})
+                        <ul>
+                            {% for p in i.postes %}
+                            <li>{{ p.nom }} [{{ p.id }}]</li>
+                            {% endfor %}
+                        </ul>
+                    </li>
+                {% endfor %}
+            </ul>
+        </li>
+    {% endfor %}
+</ul>
+{% endblock %}
index 9b708ea..970fa8e 100644 (file)
@@ -9,6 +9,7 @@ urlpatterns = patterns(
     url(r'^admin/rh/rapports/remuneration$', 'rapports_remuneration', name='rhr_remuneration'),
     url(r'^admin/rh/rapports/postes_par_service$', 'rapports_postes_service', name='rhr_postes_service'),
     url(r'^admin/rh/rapports/postes_par_implantation$', 'rapports_postes_implantation', name='rhr_postes_implantation'),
+    url(r'^admin/rh/rapports/postes_modelisation$', 'rapports_postes_modelisation', name='rhr_postes_modelisation'),
     url(r'^admin/rh/dossier/(\d+)/apercu/$', 'dossier_apercu', name='dossier_apercu'),
     url(r'^admin/rh/employe/(\d+)/apercu/$', 'employe_apercu', name='employe_apercu'),
     url(r'^admin/rh/poste/(\d+)/apercu/$', 'poste_apercu', name='poste_apercu'),
index e27ca7c..b4de8ce 100644 (file)
@@ -282,6 +282,30 @@ def rapports_remuneration(request):
 
 @login_required
 @drh_or_admin_required
+def rapports_postes_modelisation(request):
+    c = {}
+    data = []
+    for r in ref.Region.objects.all():
+        implantations = []
+        for i in ref.modelisation.objects.filter(region=r):
+            implantations.append({
+                'implantation': i,
+                'postes': rh.Poste.objects.filter(implantation=i),
+                'num_postes': rh.Poste.objects.filter(implantation=i).count(),
+                })
+        data.append({
+            'region': r,
+            'implantations': implantations
+            })
+
+    c['data'] = data
+
+
+    return render_to_response('rh/rapports/postes_modelisation.html', c, RequestContext(request))
+
+
+@login_required
+@drh_or_admin_required
 def rapports_postes_implantation(request):
     c = {}
     data = []