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