poste apercu
[auf_rh_dae.git] / project / rh / views.py
CommitLineData
e9bbd6ba 1# -*- encoding: utf-8 -*-
22343fe7 2
c9122f1d 3from datetime import date
a7de62d7 4from itertools import izip
9b0a8554 5
9f55f18a
JPC
6import pygraphviz as pgv
7
dcd1b959 8from django.core.urlresolvers import reverse
fbe60a9d 9from django.db.models import Q
3411ac33 10from django.contrib.auth.decorators import login_required
fd009814 11from django.utils.encoding import smart_str
22343fe7 12from django.shortcuts import render_to_response, get_object_or_404
e9bbd6ba 13from django.template import RequestContext
a251ac8d 14from django.http import HttpResponse
e9bbd6ba 15
d04d084c 16from datamaster_modeles import models as ref
ae936f8d 17
d04d084c 18from rh import models as rh
e2c0b1ac 19from rh.lib import calc_remun
02c1b3dc 20from rh.decorators import drh_or_admin_required
9d53bc73 21from rh.templatetags.rapports import SortHeaders
f0f6b03e 22from rh.change_list import RechercheTemporelle
5c0f1778 23from rh import graph as rh_graph
a9faef67 24
9817fed5
OL
25# pas de reference a DAE devrait etre refactorisé
26from dae.utils import get_employe_from_user
27from dae.decorators import redirect_interdiction
28from dae.workflow import grp_drh, grp_correspondants_rh
baf9b78c 29from django.conf import settings
9817fed5 30
22343fe7 31
c9122f1d 32@login_required
33def profil(request):
34 """Profil personnel de l'employé - éditable"""
35 rc = RequestContext(request)
36 c = {}
22343fe7 37
c9122f1d 38 employe = rc['this_employe']
22343fe7 39
c9122f1d 40 c['user'] = request.user
41 c['employe'] = employe
c9122f1d 42 return render_to_response('rh/profil.html', c, rc)
22343fe7
OL
43
44
3411ac33 45@login_required
a9faef67 46def employes_liste(request):
47 """Liste des employés."""
5ea6b5bb 48 today = date.today()
49 employes = rh.Employe.objects \
5ea6b5bb 50 .exclude(dossiers__date_debut__gt=today) \
51 .exclude(dossiers__date_fin__lt=today) \
52 .order_by('nom')
a9faef67 53 c = {
22343fe7
OL
54 'user': request.user,
55 'employes': employes,
a9faef67 56 }
22343fe7
OL
57 return render_to_response('rh/employes_liste.html',
58 c,
59 RequestContext(request))
60
61
3411ac33 62@login_required
a9faef67 63def employe(request, id):
64 """Information publique sur un employé."""
65 try:
66 employe = rh.Employe.objects.get(pk=id)
67 except:
68 employe = rh.Employe.objects.none()
69 c = {
22343fe7
OL
70 'user': request.user,
71 'employe': employe,
a9faef67 72 }
73 return render_to_response('rh/employe.html', c, RequestContext(request))
63e17dff
PP
74
75
08faf06e
JPC
76@login_required
77@drh_or_admin_required
63e17dff
PP
78def rapports_poste(request):
79
fd009814
PP
80 lookup_params = dict(request.GET.items())
81
82 for key, value in lookup_params.items():
9d53bc73
JPC
83 if key == 'o' or key == 'ot':
84 del lookup_params[key]
85 continue
fd009814
PP
86 if not isinstance(key, str):
87 # 'key' will be used as a keyword argument later, so Python
88 # requires it to be a string.
89 del lookup_params[key]
90 lookup_params[smart_str(key)] = value
91
7821915f 92 if key == 'comble':
7821915f
PP
93 del lookup_params[key]
94
ed3cbb32
OL
95 postes = rh.Poste.objects.select_related('implantation') \
96 .extra(select={'employe_id':'select group_concat(employe separator "|") from rh_dossier where poste=rh_poste.id and rh_dossier.date_fin is null %s' % \
9202c5db
JPC
97 ("%s" % (('order by employe %s' % ('asc' if 'ot' in request.GET and request.GET['ot'] == "asc" else "desc"))) if 'o' in request.GET and request.GET['o'] == "employe_id" else "") \
98 }) \
ed3cbb32 99 .extra(select={'employe_nom':'select group_concat(rh_employe.nom separator "|") from rh_dossier inner join rh_employe on rh_dossier.employe = rh_employe.id where poste=rh_poste.id and rh_dossier.date_fin is null %s' % \
9202c5db
JPC
100 ("%s" % (('order by rh_employe.nom %s' % ('asc' if 'ot' in request.GET and request.GET['ot'] == "asc" else "desc"))) if 'o' in request.GET and request.GET['o'] == "employe_nom" else "") \
101 }) \
ed3cbb32 102 .extra(select={'employe_prenom':'select group_concat(rh_employe.prenom separator "|") from rh_dossier inner join rh_employe on rh_dossier.employe = rh_employe.id where poste=rh_poste.id and rh_dossier.date_fin is null %s' % \
9202c5db
JPC
103 ("%s" % (('order by rh_employe.prenom %s' % ('asc' if 'ot' in request.GET and request.GET['ot'] == "asc" else "desc"))) if 'o' in request.GET and request.GET['o'] == "employe_prenom" else "") \
104 })
9d53bc73 105
65e02621 106 postes = postes.filter(**lookup_params)
9d53bc73 107 if 'o' in request.GET:
65e02621
JPC
108 postes = postes.order_by("%s%s" % ('-' if 'ot' in request.GET and request.GET['ot'] == "desc" else '', request.GET['o']))
109
a7de62d7
JPC
110 out = []
111 for p in postes:
112 out.append({
113 'id': p.id,
114 'nom': p.nom,
115 'implantation': p.implantation,
116 'employes': [] if not p.employe_id else [{'id': id, 'nom': nom, 'prenom': prenom} for id, nom, prenom in izip(p.employe_id.split('|'), p.employe_nom.split('|'), p.employe_prenom.split('|'))] })
117
118
4dade240
JPC
119 headers = [
120 ("id", u"# du poste"),
121 ("nom", u"Nom du poste"),
65e02621 122 ("implantation__id", u"Implantation"),
4dade240 123 ("employe_nom", u"Nom"),
4dade240
JPC
124 ]
125 h = SortHeaders(request, headers, order_field_type="ot", order_field="o")
63e17dff
PP
126 c = {
127 'title': 'Rapport des postes',
a7de62d7
JPC
128 'postes': out,
129 'count': len(out),
65e02621 130 'headers': list(h.headers()),
63e17dff
PP
131 }
132
133 return render_to_response('rh/rapports/postes.html', c, RequestContext(request))
f2d65e83 134
02c1b3dc
JPC
135@login_required
136@drh_or_admin_required
f2d65e83 137def rapports_contrat(request):
dcd1b959
OL
138 if 'HTTP_REFERER' in request.META.keys():
139 referer = request.META['HTTP_REFERER']
140 referer = "/".join(referer.split('/')[3:])
141 referer = "/%s" % referer.split('?')[0]
142 if referer != reverse('rhr_contrats'):
143 params = request.GET.copy()
144 params.update({'statut': 'Actif'})
145 request.GET = params
f2d65e83
PP
146
147 lookup_params = dict(request.GET.items())
65e02621
JPC
148 if 'ot' in lookup_params:
149 del lookup_params['ot']
150 if 'o' in lookup_params:
151 del lookup_params['o']
f2d65e83
PP
152
153 for key, value in lookup_params.items():
154 if not isinstance(key, str):
155 # 'key' will be used as a keyword argument later, so Python
156 # requires it to be a string.
157 del lookup_params[key]
158 lookup_params[smart_str(key)] = value
159
65e02621 160 contrats = rh.Contrat.objects.select_related('dossier', 'dossier__poste', 'dossier__poste__implantation', 'type_contrat', 'dossier__employe')
22343fe7 161
6bee05ff 162 cl = RechercheTemporelle(dict(request.GET.items()), rh.Contrat)
f0f6b03e 163 lookup_params = cl.purge_params(lookup_params)
dcd1b959
OL
164 q_temporel = cl.get_q_temporel(contrats)
165 q = Q(**lookup_params) & q_temporel
166 contrats = contrats.filter(q).exclude(dossier__employe__supprime=1)
f0f6b03e 167
65e02621
JPC
168 if 'o' in request.GET:
169 contrats = contrats.order_by("%s%s" % ('-' if 'ot' in request.GET and request.GET['ot'] == "desc" else '', request.GET['o']))
f2d65e83 170
8ee135b7
JPC
171 employes = set([c.dossier.employe_id for c in contrats])
172
65e02621
JPC
173 headers = [
174 ("dossier__employe__id", u"# de l'employé"),
175 ("dossier__employe__nom", u"Nom"),
176 ("dossier__employe__prenom", u"Prénom"),
177 ("type_contrat__nom", u"Poste"),
178 ("type_contrat__nom", u"Type de contrat"),
179 ("date_debut", u"Date début"),
180 ("date_fin", u"Date fin"),
181 ]
182 h = SortHeaders(request, headers, order_field_type="ot", order_field="o")
183
f2d65e83 184 c = {
f0f6b03e 185 'cl' : cl,
f2d65e83
PP
186 'title': 'Rapport des contrats',
187 'contrats': contrats,
8ee135b7
JPC
188 'count': len(contrats),
189 'count_employe' : len(employes),
65e02621 190 'headers': list(h.headers()),
f2d65e83
PP
191 }
192
193 return render_to_response('rh/rapports/contrats.html', c, RequestContext(request))
e2c0b1ac
PP
194
195
02c1b3dc
JPC
196@login_required
197@drh_or_admin_required
e2c0b1ac
PP
198def rapports_remuneration(request):
199
200 lookup_params = dict(request.GET.items())
9202c5db
JPC
201 if 'ot' in lookup_params:
202 del lookup_params['ot']
203 if 'o' in lookup_params:
204 del lookup_params['o']
e2c0b1ac
PP
205
206 for key, value in lookup_params.items():
207 if not isinstance(key, str):
208 # 'key' will be used as a keyword argument later, so Python
209 # requires it to be a string.
210 del lookup_params[key]
211 lookup_params[smart_str(key)] = value
212
213 employes = rh.Employe.objects.all()
9202c5db
JPC
214 if 'o' in request.GET:
215 employes = employes.order_by("%s%s" % ('-' if 'ot' in request.GET and request.GET['ot'] == "desc" else '', request.GET['o']))
216
e2c0b1ac
PP
217 employes = employes.filter(**lookup_params)
218
219 output = []
9202c5db
JPC
220 headers = [
221 ("id", u"# de l'employé"),
222 ("nom", u"Nom"),
223 ("prenom", u"Prénom"),
224 ("", u"Salaire"),
225 ("", u"RAS"),
226 ("", u"Indemnités"),
227 ("", u"Accessoire"),
228 ("", u"Charges patronales"),
229 ("", u"Total"),
230 ]
231 h = SortHeaders(request, headers, order_field_type="ot", order_field="o")
e2c0b1ac
PP
232
233 for employe in employes:
234 line = {}
235 output.append(line)
236
da6c523f 237 dossiers = employe.rh_dossiers.all()
e2c0b1ac
PP
238
239 remun = {}
240 remun_sum_euro = 0
241
242 for dossier in dossiers:
243 this_remun, this_remun_sum, this_remun_sum_euro = calc_remun(dossier)
244
245 for item in this_remun:
246 if item not in remun:
247 remun[item] = this_remun[item]
248 else:
249 remun[item][0] += this_remun[item][0]
250 remun[item][1] += this_remun[item][1]
251
252 remun_sum_euro += this_remun_sum_euro
253
254 line['remun_sum_euro'] = remun_sum_euro
255
256 for r in remun:
257 if r == u'Indemnité':
e2c0b1ac
PP
258 line['Indemnite'] = remun[r][1]
259 else:
260 line[r] = remun[r][1]
261
262 line['id'] = employe.id
263 line['nom'] = employe.nom
264 line['prenom'] = employe.prenom
265
266
267 c = {
268 'title': 'Rapport de remuneration',
269 'employes': output,
9202c5db 270 'headers': list(h.headers()),
e2c0b1ac
PP
271 }
272
273 return render_to_response('rh/rapports/remuneration.html', c, RequestContext(request))
3ebc0952 274
783e077a
JPC
275@login_required
276@drh_or_admin_required
c8b22fd1
JPC
277def rapports_employe_sans_contrat(request):
278
279 lookup_params = dict(request.GET.items())
280 if 'ot' in lookup_params:
281 del lookup_params['ot']
282 if 'o' in lookup_params:
283 del lookup_params['o']
284
285 for key, value in lookup_params.items():
286 if not isinstance(key, str):
287 # 'key' will be used as a keyword argument later, so Python
288 # requires it to be a string.
289 del lookup_params[key]
290 lookup_params[smart_str(key)] = value
291
292 employes_query = rh.Employe.objects
293 if 'o' in request.GET:
294 employes_query = employes_query.order_by("%s%s" % ('-' if 'ot' in request.GET and request.GET['ot'] == "desc" else '', request.GET['o']))
295
7c5645f0 296 employes = {}
22343fe7 297
00c9d7c2
OL
298 dossiers_en_cours = rh.Dossier.objects.filter(Q(date_fin=None) | Q(date_fin__gt=date.today()))
299 tous_contrats_echus = rh.Contrat.objects.filter(date_fin__lt=date.today(), dossier__in=dossiers_en_cours)
300 contrats = tous_contrats_echus.filter(**lookup_params).all()
301 for c in contrats:
302 if c.dossier.employe.id not in employes.keys():
303 employes[c.dossier.employe.id] = {'employe': c.dossier.employe, 'dossiers': []}
304 employes[c.dossier.employe.id]['dossiers'] += [c.dossier,]
22343fe7 305
00c9d7c2 306
c8b22fd1
JPC
307
308 headers = [
1d2d4dc2
JPC
309 ("id", u"# de l'employé"),
310 ("nom", u"Nom"),
311 ("prenom", u"Prénom"),
80518280 312 ("dossier", u"Dossiers"),
c8b22fd1 313 ]
80518280 314 h = SortHeaders(request, headers, order_field_type="ot", order_field="o", not_sortable=('dossier',))
c8b22fd1
JPC
315
316 c = {
317 'title': u'Rapport des employés sans contrat',
318 'employes': employes,
319 'count': len(employes),
320 'headers': list(h.headers()),
321 }
322
323 return render_to_response('rh/rapports/employes_sans_contrat.html', c, RequestContext(request))
324
325@login_required
326@drh_or_admin_required
857b5c24
JPC
327def rapports_postes_modelisation(request):
328 c = {}
329 data = []
3c1ba807
JPC
330
331 for f in rh.FamilleEmploi.objects.all():
332 types = rh.TypePoste.objects.filter(famille_emploi=f)
333 data_types = []
334 for t in types.all():
335 postes = rh.Poste.objects.filter(type_poste=t)
336 data_types.append({
337 'num_postes': postes.count(),
338 'postes': postes.all(),
339 'type': f,
857b5c24 340 })
3c1ba807 341
857b5c24 342 data.append({
3c1ba807
JPC
343 'famille': f,
344 'nb_types': types.count(),
345 'types' : data_types
857b5c24
JPC
346 })
347
348 c['data'] = data
349
350
351 return render_to_response('rh/rapports/postes_modelisation.html', c, RequestContext(request))
352
353
354@login_required
355@drh_or_admin_required
783e077a
JPC
356def rapports_postes_implantation(request):
357 c = {}
358 data = []
359 for r in ref.Region.objects.all():
360 implantations = []
361 for i in ref.Implantation.objects.filter(region=r):
362 implantations.append({
363 'implantation': i,
364 'postes': rh.Poste.objects.filter(implantation=i),
365 'num_postes': rh.Poste.objects.filter(implantation=i).count(),
366 })
367 data.append({
368 'region': r,
369 'implantations': implantations
370 })
371
372 c['data'] = data
373
374
375 return render_to_response('rh/rapports/postes_implantation.html', c, RequestContext(request))
376
377
378@login_required
379@drh_or_admin_required
380def rapports_postes_service(request):
381 c = {}
9988aafb
JPC
382 data = []
383 for s in rh.Service.objects.all():
384 postes = rh.Poste.objects.filter(service=s).all()
385 num_postes = rh.Poste.objects.filter(service=s).count()
22343fe7 386 data.append({'service': s, 'num_postes': num_postes, 'postes': postes})
783e077a 387
9988aafb
JPC
388 c['data'] = data
389 return render_to_response('rh/rapports/postes_service.html', c, RequestContext(request))
783e077a
JPC
390
391
32373f2e
OL
392def region_protected(model):
393 def wrapper(func):
394 def wrapped(request, id):
32373f2e
OL
395 if request.user.is_superuser:
396 return func(request, id)
397 user_groups = request.user.groups.all()
398 if grp_drh in user_groups:
399 return func(request, id)
400 if grp_correspondants_rh in user_groups:
401 employe = get_employe_from_user(request.user)
402 q = Q(**{model.prefix_implantation: employe.implantation.region})
403 qs = model.objects.filter(q)
718abc4d 404 if int(id) in [o.id for o in qs]:
32373f2e
OL
405 return func(request, id)
406 return redirect_interdiction(request)
407 return wrapped
408 return wrapper
409
410
411@region_protected(rh.Dossier)
3ebc0952 412def dossier_apercu(request, dossier_id):
baf9b78c 413 d = get_object_or_404(rh.Dossier, pk=dossier_id)
3ebc0952 414 c = {
838bc59d 415 'title': u"Dossier %s" % (d, ),
3ebc0952 416 'is_popup' : request.GET.get('_popup', False),
baf9b78c 417 'dossier' : d,
520ab455
JPC
418 'pieces' : rh.DossierPiece.objects.filter(dossier__exact=d),
419 'contrats' : rh.Contrat.objects.filter(dossier__exact=d),
2a36598b 420 'commentaires' : rh.DossierCommentaire.objects.filter(dossier__exact=d).all(),
abf91905 421 'media_url': settings.PRIVE_MEDIA_URL,
3ebc0952
OL
422 }
423 return render_to_response('admin/rh/dossier/apercu.html', c, RequestContext(request))
4a1f2ece 424
fbe60a9d
OL
425@region_protected(rh.Poste)
426def poste_apercu(request, poste_id):
c8cb18e3 427 p = get_object_or_404(rh.Poste, pk=poste_id)
fbe60a9d 428 c = {
c8cb18e3 429 'title': u"Poste %s" % (p, ),
fbe60a9d 430 'is_popup' : request.GET.get('_popup', False),
c8cb18e3 431 'poste' : p,
0dcfc806
JPC
432 'financements' : rh.PosteFinancement.objects.filter(poste=poste_id).all(),
433 'pieces' : rh.PostePiece.objects.filter(poste=poste_id).all(),
434 'dossiers' : rh.Dossier.objects.filter(poste=poste_id).order_by("-date_debut").all(),
435 'comparaisons' : rh.PosteComparaison.objects.filter(poste=poste_id).all(),
436 'commentaires' : rh.PosteCommentaire.objects.filter(poste=poste_id).all(),
abf91905 437 'media_url': settings.PRIVE_MEDIA_URL,
fbe60a9d
OL
438 }
439 return render_to_response('admin/rh/poste/apercu.html', c, RequestContext(request))
440
4a1f2ece
OL
441def employe_apercu(request, employe_id):
442 employe = get_object_or_404(rh.Employe, pk=employe_id)
fbe60a9d 443 user_groups = request.user.groups.all()
fbe60a9d
OL
444 dossiers = None
445
446 if request.user.is_superuser or \
447 grp_drh in user_groups:
448 q = Q(employe=employe)
449 if grp_correspondants_rh in user_groups:
7eeafa57 450 regions = [d.poste.implantation.region for d in employe.rh_dossiers.all()]
fbe60a9d 451 q = Q(employe=employe) & Q(implantation__region__in=regions)
22343fe7
OL
452
453 dossiers = rh.Dossier.objects.filter(q).order_by('-date_debut')
454
4a1f2ece
OL
455 c = {
456 'is_popup' : request.GET.get('_popup', False),
457 'employe' : employe,
fbe60a9d 458 'dossiers' : dossiers,
abf91905 459 'media_url': settings.PRIVE_MEDIA_URL,
4a1f2ece
OL
460 }
461 return render_to_response('admin/rh/employe/apercu.html', c, RequestContext(request))
150d83ec 462
77bd83d1
JPC
463@login_required
464@drh_or_admin_required
56264a85 465def organigrammes_employe(request, id, level="all"):
08faf06e
JPC
466
467 poste = get_object_or_404(rh.Poste, pk=id)
5c0f1778
JPC
468 dossiers_by_poste = dict((d.poste_id, d) for d in rh.Dossier.objects.select_related('employe', 'poste').all())
469 postes_by_id = dict((p.id, p) for p in rh.Poste.objects.all())
470
471 e = dossiers_by_poste[poste.id].employe
472 name = u"Organigramme de [%s] %s %s" % (e.id, e.nom.upper(), e.prenom)
58014aec 473 graph = pgv.AGraph()
5c0f1778 474
f187a10f 475 if rh.Poste.objects.filter(responsable=poste).count() > 0:
58014aec
JPC
476 postes_handle = [poste]
477 while postes_handle:
478 postes_handle = rh.Poste.objects.select_related('implantation').filter((Q(date_fin__gt=date.today()) | Q(date_fin=None)) & (Q(date_debut__lt=date.today()) | Q(date_debut=None)) ).filter(responsable__in=postes_handle).exclude(supprime=True).exclude(responsable=None).all()
32373f2e 479
58014aec
JPC
480 for p in postes_handle:
481 if p.responsable_id != p.id:
482 graph.add_edge(dossiers_by_poste[p.responsable_id].poste_id, p.id)
13ad5ad5 483
f187a10f 484 else:
5c0f1778
JPC
485 graph.add_node(poste.id)
486
4afec2e1
JPC
487 if level != "all":
488 postes_niveau = [poste.id]
489 for niveau in range(int(level)):
490 postes_niveau = [p.id for p in rh.Poste.objects.filter(responsable__in=postes_niveau).all()]
491
492 while postes_niveau:
493 postes_niveau = [p.id for p in rh.Poste.objects.filter(responsable__in=postes_niveau).all()]
494 if postes_niveau:
495 for p in postes_niveau:
496 if graph.has_node(p):
497 graph.remove_node(p)
498
58014aec 499 a = graph
4afec2e1 500 a.name = name.encode('ascii', 'xmlcharrefreplace')
5c0f1778
JPC
501
502 poste_remontant = poste
503 while poste_remontant.responsable_id:
504 a.add_edge(poste_remontant.responsable_id, poste_remontant.id)
505 poste_remontant = poste_remontant.responsable
506
507 rh_graph.bind_poste_to_graph(a, postes_by_id)
508 #a.graph_attr['normalize'] = True
509 #a.graph_attr['level'] = 2
510 a.layout(prog='dot')
511
512 svg = a.draw(format='svg')
513
514 c = {
515 'svg': svg
516 }
a251ac8d
JPC
517
518 if 'forcer' in request.GET:
519 response = HttpResponse(svg, mimetype='image/svg+xml')
520 response['Content-Disposition'] = 'attachment; filename=organigramme.svg'
521 return response
522
c548bef6 523 return render_to_response('rh/organigrammes/employe.html', c, RequestContext(request), mimetype="image/svg+xml")
5c0f1778
JPC
524
525
526@login_required
527@drh_or_admin_required
528def organigrammes_service(request, id):
529
530 service = get_object_or_404(rh.Service, pk=id)
82af5c19
JPC
531 svg = rh_graph.organigramme_postes_cluster( \
532 cluster_filter={"service": service}, \
533 titre=u"Organigramme du service %s" % service.nom,
534 cluster_titre=service.nom)
5c0f1778 535
82af5c19
JPC
536 c = {
537 'svg': svg
538 }
5c0f1778 539
6dec02db 540 return render_to_response('rh/organigrammes/vide.html', c, RequestContext(request), mimetype="image/svg+xml")
5c0f1778 541
82af5c19
JPC
542@login_required
543@drh_or_admin_required
544def organigrammes_implantation(request, id):
5c0f1778 545
82af5c19
JPC
546 implantation = get_object_or_404(ref.Implantation, pk=id)
547 svg = rh_graph.organigramme_postes_cluster( \
548 cluster_filter={"implantation": implantation}, \
549 titre=u"Organigramme de l'implantation %s" % implantation.nom,
550 cluster_titre=implantation.nom)
5c0f1778
JPC
551
552 c = {
553 'svg': svg
554 }
555
6dec02db 556 return render_to_response('rh/organigrammes/vide.html', c, RequestContext(request), mimetype="image/svg+xml")
5c0f1778 557
9da4c195
JPC
558@login_required
559@drh_or_admin_required
560def organigrammes_region(request, id):
561
562 region = get_object_or_404(ref.Region, pk=id)
563 svg = rh_graph.organigramme_postes_cluster( \
564 cluster_filter={"implantation__region": region}, \
565 titre=u"Organigramme du bureau de %s" % region.nom,
566 cluster_titre=region.nom)
567
568 c = {
569 'svg': svg
570 }
571
572 return render_to_response('rh/organigrammes/vide.html', c, RequestContext(request), mimetype="image/svg+xml")
573