Merge branch 'dev' of ssh://git.auf/auf_rh_dae into dev
authorOlivier Larchevêque <olivier.larcheveque@auf.org>
Fri, 17 Feb 2012 19:52:24 +0000 (14:52 -0500)
committerOlivier Larchevêque <olivier.larcheveque@auf.org>
Fri, 17 Feb 2012 19:52:24 +0000 (14:52 -0500)
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..b1ddf68
--- /dev/null
@@ -0,0 +1,27 @@
+{% extends 'rh/rapports/base.html' %}
+{% load adminmedia rapports i18n %}
+
+{% block nomrapport %}Rapport postes par implantation{% endblock %}
+{% block count_elements %}{% endblock %}
+
+{% block contentrapport %}
+<ul>
+    {% for f in data %}
+    <li>
+        {{ f.famille.nom }} ({{ f.nb_types }})
+        <ul>
+            {% for t in f.types %}
+                <li>
+                    {{ t.type.nom }} ({{ t.num_postes }})
+                    <ul>
+                    {% for p in t.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..c7e494d 100644 (file)
@@ -282,6 +282,35 @@ def rapports_remuneration(request):
 
 @login_required
 @drh_or_admin_required
+def rapports_postes_modelisation(request):
+    c = {}
+    data = []
+
+    for f in rh.FamilleEmploi.objects.all():
+        types = rh.TypePoste.objects.filter(famille_emploi=f)
+        data_types = []
+        for t in types.all():
+            postes = rh.Poste.objects.filter(type_poste=t)
+            data_types.append({
+                'num_postes': postes.count(),
+                'postes': postes.all(),
+                'type': f,
+                })
+
+        data.append({
+            'famille': f,
+            'nb_types': types.count(),
+            'types' : data_types
+            })
+
+    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 = []