Masse salariale: export en ODS
[auf_rh_dae.git] / project / rh / views.py
1 # -*- encoding: utf-8 -*-
2
3 import urllib
4 from datetime import date
5 from itertools import izip
6 import StringIO
7
8 import pygraphviz as pgv
9
10 from django.core.urlresolvers import reverse
11 from django.db.models import Q
12 from django.utils.encoding import smart_str
13 from django.shortcuts import render_to_response, get_object_or_404
14 from django.template import RequestContext
15 from django.http import HttpResponse
16 from django import forms
17 from django.contrib.auth.decorators import login_required
18 from django.contrib.admin import widgets as adminwidgets
19 from django.core.servers.basehttp import FileWrapper
20
21 from datamaster_modeles import models as ref
22
23 from rh import models as rh
24 from rh.lib import calc_remun
25 from rh.decorators import drh_or_admin_required
26 from rh.templatetags.rapports import SortHeaders
27 from rh.change_list import RechercheTemporelle
28 from rh import graph as rh_graph
29 from rh.masse_salariale import MasseSalariale
30
31 # pas de reference a DAE devrait etre refactorisé
32 from dae.utils import get_employe_from_user
33 from dae.decorators import redirect_interdiction
34 from dae.workflow import grp_drh, grp_correspondants_rh
35 from django.conf import settings
36
37
38 @login_required
39 def profil(request):
40 """Profil personnel de l'employé - éditable"""
41 rc = RequestContext(request)
42 c = {}
43
44 employe = rc['this_employe']
45
46 c['user'] = request.user
47 c['employe'] = employe
48 return render_to_response('rh/profil.html', c, rc)
49
50
51 @login_required
52 def employes_liste(request):
53 """Liste des employés."""
54 today = date.today()
55 employes = rh.Employe.objects \
56 .exclude(dossiers__date_debut__gt=today) \
57 .exclude(dossiers__date_fin__lt=today) \
58 .order_by('nom')
59 c = {
60 'user': request.user,
61 'employes': employes,
62 }
63 return render_to_response('rh/employes_liste.html',
64 c,
65 RequestContext(request))
66
67
68 @login_required
69 def employe(request, id):
70 """Information publique sur un employé."""
71 try:
72 employe = rh.Employe.objects.get(pk=id)
73 except:
74 employe = rh.Employe.objects.none()
75 c = {
76 'user': request.user,
77 'employe': employe,
78 }
79 return render_to_response('rh/employe.html', c, RequestContext(request))
80
81
82 @login_required
83 @drh_or_admin_required
84 def rapports_poste(request):
85
86 lookup_params = dict(request.GET.items())
87
88 for key, value in lookup_params.items():
89 if key == 'o' or key == 'ot':
90 del lookup_params[key]
91 continue
92 if not isinstance(key, str):
93 # 'key' will be used as a keyword argument later, so Python
94 # requires it to be a string.
95 del lookup_params[key]
96 lookup_params[smart_str(key)] = value
97
98 if key == 'comble':
99 del lookup_params[key]
100
101 postes = rh.Poste.objects.select_related('implantation') \
102 .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' % \
103 ("%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 "") \
104 }) \
105 .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' % \
106 ("%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 "") \
107 }) \
108 .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' % \
109 ("%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 "") \
110 })
111
112 postes = postes.filter(**lookup_params)
113 if 'o' in request.GET:
114 postes = postes.order_by("%s%s" % ('-' if 'ot' in request.GET and request.GET['ot'] == "desc" else '', request.GET['o']))
115
116 out = []
117 for p in postes:
118 out.append({
119 'id': p.id,
120 'nom': p.nom,
121 'implantation': p.implantation,
122 '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('|'))] })
123
124
125 headers = [
126 ("id", u"# du poste"),
127 ("nom", u"Nom du poste"),
128 ("implantation__id", u"Implantation"),
129 ("employe_nom", u"Nom"),
130 ]
131 h = SortHeaders(request, headers, order_field_type="ot", order_field="o")
132 c = {
133 'title': 'Rapport des postes',
134 'postes': out,
135 'count': len(out),
136 'headers': list(h.headers()),
137 }
138
139 return render_to_response('rh/rapports/postes.html', c, RequestContext(request))
140
141 @login_required
142 @drh_or_admin_required
143 def rapports_contrat(request):
144 if 'HTTP_REFERER' in request.META.keys():
145 referer = request.META['HTTP_REFERER']
146 referer = "/".join(referer.split('/')[3:])
147 referer = "/%s" % referer.split('?')[0]
148 if referer != reverse('rhr_contrats'):
149 params = request.GET.copy()
150 params.update({'statut': 'Actif'})
151 request.GET = params
152
153 lookup_params = dict(request.GET.items())
154 if 'ot' in lookup_params:
155 del lookup_params['ot']
156 if 'o' in lookup_params:
157 del lookup_params['o']
158
159 for key, value in lookup_params.items():
160 if not isinstance(key, str):
161 # 'key' will be used as a keyword argument later, so Python
162 # requires it to be a string.
163 del lookup_params[key]
164 lookup_params[smart_str(key)] = value
165
166 contrats = rh.Contrat.objects.select_related('dossier', 'dossier__poste', 'dossier__poste__implantation', 'type_contrat', 'dossier__employe')
167
168 cl = RechercheTemporelle(dict(request.GET.items()), rh.Contrat)
169 lookup_params = cl.purge_params(lookup_params)
170 q_temporel = cl.get_q_temporel(contrats)
171 q = Q(**lookup_params) & q_temporel
172 contrats = contrats.filter(q).exclude(dossier__employe__supprime=1)
173
174 if 'o' in request.GET:
175 contrats = contrats.order_by("%s%s" % ('-' if 'ot' in request.GET and request.GET['ot'] == "desc" else '', request.GET['o']))
176
177 employes = set([c.dossier.employe_id for c in contrats])
178
179 headers = [
180 ("dossier__employe__id", u"# de l'employé"),
181 ("dossier__employe__nom", u"Nom"),
182 ("dossier__employe__prenom", u"Prénom"),
183 ("type_contrat__nom", u"Poste"),
184 ("type_contrat__nom", u"Type de contrat"),
185 ("date_debut", u"Date début"),
186 ("date_fin", u"Date fin"),
187 ]
188 h = SortHeaders(request, headers, order_field_type="ot", order_field="o")
189
190 c = {
191 'cl' : cl,
192 'title': 'Rapport des contrats',
193 'contrats': contrats,
194 'count': len(contrats),
195 'count_employe' : len(employes),
196 'headers': list(h.headers()),
197 }
198
199 return render_to_response('rh/rapports/contrats.html', c, RequestContext(request))
200
201
202 @login_required
203 @drh_or_admin_required
204 def rapports_masse_salariale(request):
205
206 class RechercheTemporelle(forms.Form):
207 CHOICE_ANNEES = range(
208 rh.Remuneration.objects.exclude(date_debut=None) \
209 .order_by('date_debut')[0].date_debut.year
210 , date.today().year + 1)
211
212 annee = forms.CharField(initial=date.today().year,
213 widget=forms.Select(choices=
214 ((a, a) for a in reversed(CHOICE_ANNEES)
215 ))
216 )
217
218 region = forms.CharField(
219 widget=forms.Select(choices=[('', '')] +
220 [(i.id, i) for i in ref.Region.objects.all()]
221 )
222 )
223
224 implantation = forms.CharField(
225 widget=forms.Select(choices=[('', '')] +
226 [(i.id, i) for i in ref.Implantation.objects.all()]
227 )
228 )
229
230 #date_debut = forms.DateField(widget=adminwidgets.AdminDateWidget)
231 #date_fin = forms.DateField(widget=adminwidgets.AdminDateWidget)
232
233
234 form = RechercheTemporelle(request.GET)
235 get_filtre = [(k, v) for k,v in request.GET.items() \
236 if k not in ('date_debut', 'date_fin', 'implantation', )]
237 query_string = urllib.urlencode(get_filtre)
238
239 date_debut = None
240 date_fin = None
241 if request.GET.get('annee', None):
242 date_debut = "01-01-%s" % request.GET.get('annee', None)
243 date_fin = "31-12-%s" % request.GET.get('annee', None)
244
245 implantation = request.GET.get('implantation')
246 region = request.GET.get('region')
247
248 custom_filter = {}
249 if implantation:
250 custom_filter['dossier__poste__implantation'] = implantation
251 if region:
252 custom_filter['dossier__poste__implantation__region'] = region
253
254 c = {
255 'title': 'Rapport de masse salariale',
256 'form': form,
257 'headers': [],
258 'query_string': query_string,
259 }
260 if date_debut or date_fin:
261 masse = MasseSalariale(date_debut, date_fin, custom_filter,
262 request.GET.get('ne_pas_grouper', False))
263 if masse.rapport:
264 if request.GET.get('ods'):
265 for h in (h for h in masse.headers if 'background-color' in h[2]):
266 del h[2]['background-color']
267 masse.ods()
268 output = StringIO.StringIO()
269 masse.doc.save(output)
270 output.seek(0)
271
272 response = HttpResponse(FileWrapper(output), content_type=
273 'application/vnd.oasis.opendocument.spreadsheet')
274 response['Content-Disposition'] = \
275 'attachment; filename=Masse Salariale %s.ods' % \
276 masse.annee
277 return response
278 else:
279 c['rapport'] = masse.rapport
280 c['header_keys'] = [h[0] for h in masse.headers]
281 #on enleve le background pour le header
282 for h in (h for h in masse.headers if 'background-color' in h[2]):
283 h[2]['background'] = 'none'
284 h = SortHeaders(request, masse.headers, order_field_type="ot",
285 not_sortable=c['header_keys'], order_field="o")
286 c['headers'] = list(h.headers())
287 for key, nom, opts in masse.headers:
288 c['headers']
289 c['total'] = masse.grand_totaux[0]
290 c['total_euro'] = masse.grand_totaux[1]
291 c['colspan'] = len(c['header_keys']) - 1
292 get_filtre.append(('ods', True))
293 query_string = urllib.urlencode(get_filtre)
294 c['url_ods'] = "%s?%s" % (
295 reverse('rhr_masse_salariale'), query_string)
296
297 return render_to_response('rh/rapports/masse_salariale.html', c, RequestContext(request))
298
299
300 @login_required
301 @drh_or_admin_required
302 def rapports_remuneration(request):
303
304 lookup_params = dict(request.GET.items())
305 if 'ot' in lookup_params:
306 del lookup_params['ot']
307 if 'o' in lookup_params:
308 del lookup_params['o']
309
310 for key, value in lookup_params.items():
311 if not isinstance(key, str):
312 # 'key' will be used as a keyword argument later, so Python
313 # requires it to be a string.
314 del lookup_params[key]
315 lookup_params[smart_str(key)] = value
316
317 employes = rh.Employe.objects.all()
318 if 'o' in request.GET:
319 employes = employes.order_by("%s%s" % ('-' if 'ot' in request.GET and request.GET['ot'] == "desc" else '', request.GET['o']))
320
321 employes = employes.filter(**lookup_params)
322
323 output = []
324 headers = [
325 ("id", u"# de l'employé"),
326 ("nom", u"Nom"),
327 ("prenom", u"Prénom"),
328 ("", u"Salaire"),
329 ("", u"RAS"),
330 ("", u"Indemnités"),
331 ("", u"Accessoire"),
332 ("", u"Charges patronales"),
333 ("", u"Total"),
334 ]
335 h = SortHeaders(request, headers, order_field_type="ot", order_field="o")
336
337 for employe in employes:
338 line = {}
339 output.append(line)
340
341 dossiers = employe.rh_dossiers.all()
342
343 remun = {}
344 remun_sum_euro = 0
345
346 for dossier in dossiers:
347 this_remun, this_remun_sum, this_remun_sum_euro = calc_remun(dossier)
348
349 for item in this_remun:
350 if item not in remun:
351 remun[item] = this_remun[item]
352 else:
353 remun[item][0] += this_remun[item][0]
354 remun[item][1] += this_remun[item][1]
355
356 remun_sum_euro += this_remun_sum_euro
357
358 line['remun_sum_euro'] = remun_sum_euro
359
360 for r in remun:
361 if r == u'Indemnité':
362 line['Indemnite'] = remun[r][1]
363 else:
364 line[r] = remun[r][1]
365
366 line['id'] = employe.id
367 line['nom'] = employe.nom
368 line['prenom'] = employe.prenom
369
370
371 c = {
372 'title': 'Rapport de remuneration',
373 'employes': output,
374 'headers': list(h.headers()),
375 }
376
377 return render_to_response('rh/rapports/remuneration.html', c, RequestContext(request))
378
379 @login_required
380 @drh_or_admin_required
381 def rapports_employe_sans_contrat(request):
382
383 lookup_params = dict(request.GET.items())
384 if 'ot' in lookup_params:
385 del lookup_params['ot']
386 if 'o' in lookup_params:
387 del lookup_params['o']
388
389 for key, value in lookup_params.items():
390 if not isinstance(key, str):
391 # 'key' will be used as a keyword argument later, so Python
392 # requires it to be a string.
393 del lookup_params[key]
394 lookup_params[smart_str(key)] = value
395
396 employes_query = rh.Employe.objects
397 if 'o' in request.GET:
398 employes_query = employes_query.order_by("%s%s" % ('-' if 'ot' in request.GET and request.GET['ot'] == "desc" else '', request.GET['o']))
399
400 employes = {}
401
402 dossiers_en_cours = rh.Dossier.objects.filter(Q(date_fin=None) | Q(date_fin__gt=date.today()))
403 tous_contrats_echus = rh.Contrat.objects.filter(date_fin__lt=date.today(), dossier__in=dossiers_en_cours)
404 contrats = tous_contrats_echus.filter(**lookup_params).all()
405 for c in contrats:
406 if c.dossier.employe.id not in employes.keys():
407 employes[c.dossier.employe.id] = {'employe': c.dossier.employe, 'dossiers': []}
408 employes[c.dossier.employe.id]['dossiers'] += [c.dossier,]
409
410
411
412 headers = [
413 ("id", u"# de l'employé"),
414 ("nom", u"Nom"),
415 ("prenom", u"Prénom"),
416 ("dossier", u"Dossiers"),
417 ]
418 h = SortHeaders(request, headers, order_field_type="ot", order_field="o", not_sortable=('dossier',))
419
420 c = {
421 'title': u'Rapport des employés sans contrat',
422 'employes': employes,
423 'count': len(employes),
424 'headers': list(h.headers()),
425 }
426
427 return render_to_response('rh/rapports/employes_sans_contrat.html', c, RequestContext(request))
428
429 @login_required
430 @drh_or_admin_required
431 def rapports_postes_modelisation(request):
432 c = {}
433 data = []
434
435 for f in rh.FamilleEmploi.objects.all():
436 types = rh.TypePoste.objects.filter(famille_emploi=f)
437 data_types = []
438 for t in types.all():
439 postes = rh.Poste.objects.filter(type_poste=t)
440 data_types.append({
441 'num_postes': postes.count(),
442 'postes': postes.all(),
443 'type': f,
444 })
445
446 data.append({
447 'famille': f,
448 'nb_types': types.count(),
449 'types' : data_types
450 })
451
452 c['data'] = data
453
454
455 return render_to_response('rh/rapports/postes_modelisation.html', c, RequestContext(request))
456
457
458 @login_required
459 @drh_or_admin_required
460 def rapports_postes_implantation(request):
461 c = {}
462 data = []
463 for r in ref.Region.objects.all():
464 implantations = []
465 for i in ref.Implantation.objects.filter(region=r):
466 implantations.append({
467 'implantation': i,
468 'postes': rh.Poste.objects.filter(implantation=i),
469 'num_postes': rh.Poste.objects.filter(implantation=i).count(),
470 })
471 data.append({
472 'region': r,
473 'implantations': implantations
474 })
475
476 c['data'] = data
477
478
479 return render_to_response('rh/rapports/postes_implantation.html', c, RequestContext(request))
480
481
482 @login_required
483 @drh_or_admin_required
484 def rapports_postes_service(request):
485 c = {}
486 data = []
487 for s in rh.Service.objects.all():
488 postes = rh.Poste.objects.filter(service=s).all()
489 num_postes = rh.Poste.objects.filter(service=s).count()
490 data.append({'service': s, 'num_postes': num_postes, 'postes': postes})
491
492 c['data'] = data
493 return render_to_response('rh/rapports/postes_service.html', c, RequestContext(request))
494
495
496 def region_protected(model):
497 def wrapper(func):
498 def wrapped(request, id):
499 if request.user.is_superuser:
500 return func(request, id)
501 user_groups = request.user.groups.all()
502 if grp_drh in user_groups:
503 return func(request, id)
504 if grp_correspondants_rh in user_groups:
505 employe = get_employe_from_user(request.user)
506 q = Q(**{model.prefix_implantation: employe.implantation.region})
507 qs = model.objects.filter(q)
508 if int(id) in [o.id for o in qs]:
509 return func(request, id)
510 return redirect_interdiction(request)
511 return wrapped
512 return wrapper
513
514
515 @region_protected(rh.Dossier)
516 def dossier_apercu(request, dossier_id):
517 d = get_object_or_404(rh.Dossier, pk=dossier_id)
518 c = {
519 'title': u"Dossier %s" % (d, ),
520 'is_popup' : request.GET.get('_popup', False),
521 'dossier' : d,
522 'pieces' : rh.DossierPiece.objects.filter(dossier__exact=d),
523 'contrats' : rh.Contrat.objects.filter(dossier__exact=d),
524 'commentaires' : rh.DossierCommentaire.objects.filter(dossier__exact=d).all(),
525 'media_url': settings.PRIVE_MEDIA_URL,
526 }
527 return render_to_response('admin/rh/dossier/apercu.html', c, RequestContext(request))
528
529 @region_protected(rh.Poste)
530 def poste_apercu(request, poste_id):
531 p = get_object_or_404(rh.Poste, pk=poste_id)
532 c = {
533 'title': u"Poste %s" % (p, ),
534 'is_popup' : request.GET.get('_popup', False),
535 'poste' : p,
536 'financements' : rh.PosteFinancement.objects.filter(poste=poste_id).all(),
537 'pieces' : rh.PostePiece.objects.filter(poste=poste_id).all(),
538 'dossiers' : rh.Dossier.objects.filter(poste=poste_id).order_by("-date_debut").all(),
539 'comparaisons' : rh.PosteComparaison.objects.filter(poste=poste_id).all(),
540 'commentaires' : rh.PosteCommentaire.objects.filter(poste=poste_id).all(),
541 'media_url': settings.PRIVE_MEDIA_URL,
542 }
543 return render_to_response('admin/rh/poste/apercu.html', c, RequestContext(request))
544
545 def employe_apercu(request, employe_id):
546 employe = get_object_or_404(rh.Employe, pk=employe_id)
547 user_groups = request.user.groups.all()
548 dossiers = None
549
550 if request.user.is_superuser or \
551 grp_drh in user_groups:
552 q = Q(employe=employe)
553 if grp_correspondants_rh in user_groups:
554 regions = [d.poste.implantation.region for d in employe.rh_dossiers.all()]
555 q = Q(employe=employe) & Q(implantation__region__in=regions)
556
557 dossiers = rh.Dossier.objects.filter(q).order_by('-date_debut')
558
559 c = {
560 'title': u"Employe %s" % (employe, ),
561 'is_popup' : request.GET.get('_popup', False),
562 'employe' : employe,
563 'dossiers' : dossiers,
564 'media_url': settings.PRIVE_MEDIA_URL,
565 }
566 return render_to_response('admin/rh/employe/apercu.html', c, RequestContext(request))
567
568 @login_required
569 @drh_or_admin_required
570 def organigrammes_employe(request, id, level="all"):
571
572 poste = get_object_or_404(rh.Poste, pk=id)
573 dossiers_by_poste = dict((d.poste_id, d) for d in rh.Dossier.objects.select_related('employe', 'poste').all())
574 postes_by_id = dict((p.id, p) for p in rh.Poste.objects.all())
575
576 e = dossiers_by_poste[poste.id].employe
577 name = u"Organigramme de [%s] %s %s" % (e.id, e.nom.upper(), e.prenom)
578 graph = pgv.AGraph()
579
580 if rh.Poste.objects.filter(responsable=poste).count() > 0:
581 postes_handle = [poste]
582 while postes_handle:
583 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()
584
585 for p in postes_handle:
586 if p.responsable_id != p.id:
587 graph.add_edge(dossiers_by_poste[p.responsable_id].poste_id, p.id)
588
589 else:
590 graph.add_node(poste.id)
591
592 if level != "all":
593 postes_niveau = [poste.id]
594 for niveau in range(int(level)):
595 postes_niveau = [p.id for p in rh.Poste.objects.filter(responsable__in=postes_niveau).all()]
596
597 while postes_niveau:
598 postes_niveau = [p.id for p in rh.Poste.objects.filter(responsable__in=postes_niveau).all()]
599 if postes_niveau:
600 for p in postes_niveau:
601 if graph.has_node(p):
602 graph.delete_node(p)
603
604 a = graph
605 a.name = name.encode('ascii', 'xmlcharrefreplace')
606
607 poste_remontant = poste
608 while poste_remontant.responsable_id:
609 a.add_edge(poste_remontant.responsable_id, poste_remontant.id)
610 poste_remontant = poste_remontant.responsable
611
612 rh_graph.bind_poste_to_graph(a, postes_by_id)
613 #a.graph_attr['normalize'] = True
614 #a.graph_attr['level'] = 2
615 a.layout(prog='dot')
616
617 svg = a.draw(format='svg')
618
619 c = {
620 'svg': svg
621 }
622
623 if 'forcer' in request.GET:
624 response = HttpResponse(svg, mimetype='image/svg+xml')
625 response['Content-Disposition'] = 'attachment; filename=organigramme.svg'
626 return response
627
628 return render_to_response('rh/organigrammes/employe.html', c, RequestContext(request), mimetype="image/svg+xml")
629
630
631 @login_required
632 @drh_or_admin_required
633 def organigrammes_service(request, id):
634
635 service = get_object_or_404(rh.Service, pk=id)
636 svg = rh_graph.organigramme_postes_cluster( \
637 cluster_filter={"service": service}, \
638 titre=u"Organigramme du service %s" % service.nom,
639 cluster_titre=service.nom)
640
641 c = {
642 'svg': svg
643 }
644
645 return render_to_response('rh/organigrammes/vide.html', c, RequestContext(request), mimetype="image/svg+xml")
646
647 @login_required
648 @drh_or_admin_required
649 def organigrammes_implantation(request, id):
650
651 implantation = get_object_or_404(ref.Implantation, pk=id)
652 svg = rh_graph.organigramme_postes_cluster( \
653 cluster_filter={"implantation": implantation}, \
654 titre=u"Organigramme de l'implantation %s" % implantation.nom,
655 cluster_titre=implantation.nom)
656
657 c = {
658 'svg': svg
659 }
660
661 return render_to_response('rh/organigrammes/vide.html', c, RequestContext(request), mimetype="image/svg+xml")
662
663 @login_required
664 @drh_or_admin_required
665 def organigrammes_region(request, id):
666
667 region = get_object_or_404(ref.Region, pk=id)
668 svg = rh_graph.organigramme_postes_cluster( \
669 cluster_filter={"implantation__region": region}, \
670 titre=u"Organigramme du bureau de %s" % region.nom,
671 cluster_titre=region.nom)
672
673 c = {
674 'svg': svg
675 }
676
677 return render_to_response('rh/organigrammes/vide.html', c, RequestContext(request), mimetype="image/svg+xml")