[#3176] Ajouté des champs pour la recherche textuelle de dossiers
[auf_rh_dae.git] / project / rh / admin.py
CommitLineData
53ae644d
OL
1# -*- encoding: utf-8 -*-
2
53ae644d
OL
3import datetime
4
fc4bf968
EMS
5from ajax_select import make_ajax_form
6from auf.django.metadata.admin import \
7 AUFMetadataAdminMixin, AUFMetadataInlineAdminMixin, \
8 AUF_METADATA_READONLY_FIELDS
53ae644d 9from django.core.urlresolvers import reverse
50fa9bc1 10from django.contrib import admin
53ae644d 11from django.conf import settings
f7badf51 12from django.db.models import Q, Count
5f36f262 13from django.template.defaultfilters import date
fc4bf968
EMS
14
15import auf.django.references.models as ref
16import models as rh
17from forms import \
18 ContratForm, AyantDroitForm, EmployeAdminForm, AjaxSelect, DossierForm
53ae644d 19from dae.utils import get_employe_from_user
a17e2236 20from change_list import ChangeList
a12ddd52
OL
21from groups import grp_correspondants_rh
22from decorators import in_drh_or_admin
fc4bf968 23
82af5c19 24
7ba822a6
OL
25class ArchiveMixin(object):
26 """
27 Archive Mixin pour gérer le queryset et le display
28 NON COMPRIS : list_filter, et list_display, field à setter dans la classe.
29 """
30
31 def queryset(self, request):
32 return self.model._base_manager
33
34 def _archive(self, obj):
35 if obj.archive:
36 return "oui"
37 else:
38 return "non"
39 _archive.short_description = u'Archivé'
40 _archive.admin_order_field = 'archive'
41
fc4bf968 42
9da4c195
JPC
43class RegionProxy(ref.Region):
44 """ Proxy utilisé pour les organigrammes par région """
45 class Meta:
46 proxy = True
47 verbose_name = u"Organigramme par région"
48 verbose_name_plural = u"Organigramme par région"
49
50
82af5c19
JPC
51class ImplantationProxy(ref.Implantation):
52 """ Proxy utilisé pour les organigrammes par implantation """
53 class Meta:
54 proxy = True
55 verbose_name = u"Organigramme par implantations"
56 verbose_name_plural = u"Organigramme par implantations"
57
22343fe7 58
5c0f1778
JPC
59class ServiceProxy(rh.Service):
60 """ Proxy utilisé pour les organigrammes opar service """
f7badf51 61
5c0f1778
JPC
62 class Meta:
63 proxy = True
64 verbose_name = u"Organigramme par services"
65 verbose_name_plural = u"Organigramme par services"
66
22343fe7 67
5c0f1778
JPC
68class EmployeProxy(rh.Employe):
69 """ Proxy utilisé pour les organigrammes des employés """
22343fe7
OL
70 class Meta:
71 proxy = True
72 verbose_name = u"Organigramme des employés"
73 verbose_name_plural = u"Organigramme des employés"
74
f614ca5c 75
40b35603 76class DateRangeMixin(object):
a17e2236 77 prefixe_recherche_temporelle = ""
22343fe7 78
40b35603 79 def get_changelist(self, request, **kwargs):
22343fe7 80 if 'HTTP_REFERER' in request.META.keys():
910e39e5
OL
81 referer = request.META['HTTP_REFERER']
82 referer = "/".join(referer.split('/')[3:])
83 referer = "/%s" % referer.split('?')[0]
22343fe7
OL
84 change_list_view = 'admin:%s_%s_changelist' % (
85 self.model._meta.app_label,
86 self.model.__name__.lower(),)
910e39e5
OL
87 if referer != reverse(change_list_view):
88 params = request.GET.copy()
22343fe7 89 params.update({'statut': 'Actif'})
910e39e5 90 request.GET = params
40b35603 91 return ChangeList
3195667e 92
22343fe7 93
53ae644d
OL
94# Override of the InlineModelAdmin to support the link in the tabular inline
95class LinkedInline(admin.options.InlineModelAdmin):
96 template = "admin/linked.html"
97 admin_model_path = None
98
99 def __init__(self, *args):
100 super(LinkedInline, self).__init__(*args)
101 if self.admin_model_path is None:
102 self.admin_model_path = self.model.__name__.lower()
103
104
105class ProtectRegionMixin(object):
106
107 def queryset(self, request):
53ae644d
OL
108 qs = super(ProtectRegionMixin, self).queryset(request)
109
53ae644d 110 user_groups = request.user.groups.all()
a12ddd52 111 if in_drh_or_admin(request.user):
53ae644d
OL
112 return qs
113
114 if grp_correspondants_rh in user_groups:
115 employe = get_employe_from_user(request.user)
22343fe7
OL
116 q = Q(**{self.model.prefix_implantation: \
117 employe.implantation.region})
53ae644d
OL
118 qs = qs.filter(q).distinct()
119 return qs
120 return qs.none()
121
c0be8705
OL
122 def has_add_permission(self, request):
123 if not in_drh_or_admin(request.user):
124 return False
125 else:
126 return True
127
53ae644d 128 def has_change_permission(self, request, obj=None):
20b4867c 129 user_groups = request.user.groups.all()
a0d365ed 130
0309aeb4
DB
131 # Lock pour autoriser uniquement les DRH à utiliser RH
132 if not in_drh_or_admin(request.user):
133 return False
134
a18bc295 135 if len(user_groups) == 0 and not request.user.is_superuser:
20b4867c
OL
136 return False
137
53ae644d
OL
138 if obj is None:
139 return True
140 ids = [o.id for o in self.queryset(request)]
141 return obj.id in ids
142
143
144# Inlines
145
146class ReadOnlyInlineMixin(object):
22343fe7 147
53ae644d 148 def get_readonly_fields(self, request, obj=None):
22343fe7
OL
149 return [f.name for f in self.model._meta.fields \
150 if f.name not in AUF_METADATA_READONLY_FIELDS]
53ae644d
OL
151
152
153class AyantDroitInline(AUFMetadataInlineAdminMixin, admin.StackedInline):
154 model = rh.AyantDroit
155 form = AyantDroitForm
156 extra = 0
157
158 fieldsets = (
159 (None, {
22343fe7
OL
160 'fields': (
161 ('nom', 'prenom'),
162 ('nom_affichage', 'genre'),
163 'nationalite',
164 'date_naissance',
165 'lien_parente',
166 )}),
53ae644d
OL
167 )
168
169
22343fe7
OL
170class AyantDroitCommentaireInline(AUFMetadataInlineAdminMixin, \
171 admin.TabularInline):
53ae644d
OL
172 readonly_fields = ('owner', )
173 model = rh.AyantDroitCommentaire
174 extra = 1
175
176
177class ContratInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
178 form = ContratForm
179 model = rh.Contrat
180 extra = 1
181
182
183class DossierROInline(ReadOnlyInlineMixin, LinkedInline):
184 template = "admin/rh/dossier/linked.html"
185 exclude = AUF_METADATA_READONLY_FIELDS
186 model = rh.Dossier
187 extra = 0
188 can_delete = False
189
190 def has_add_permission(self, request=None):
191 return False
192
193 def has_change_permission(self, request, obj=None):
194 return False
195
196 def has_delete_permission(self, request, obj=None):
197 return False
198
199
22343fe7
OL
200class DossierCommentaireInline(AUFMetadataInlineAdminMixin, \
201 admin.TabularInline):
53ae644d
OL
202 readonly_fields = ('owner', )
203 model = rh.DossierCommentaire
204 extra = 1
205
206
207class DossierPieceInline(admin.TabularInline):
208 model = rh.DossierPiece
209 extra = 4
210
211
212class EmployeInline(admin.TabularInline):
213 model = rh.Employe
214
22343fe7
OL
215
216class EmployeCommentaireInline(AUFMetadataInlineAdminMixin, \
217 admin.TabularInline):
53ae644d
OL
218 readonly_fields = ('owner', )
219 model = rh.EmployeCommentaire
220 extra = 1
221
222
223class EmployePieceInline(admin.TabularInline):
224 model = rh.EmployePiece
225 extra = 4
226
227
53ae644d
OL
228class PosteCommentaireInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
229 readonly_fields = ('owner', )
230 model = rh.PosteCommentaire
231 extra = 1
232
233
234class PosteFinancementInline(admin.TabularInline):
235 model = rh.PosteFinancement
236
237
238class PostePieceInline(admin.TabularInline):
239 model = rh.PostePiece
240
241
242class RemunerationInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
243 model = rh.Remuneration
244 extra = 1
245
246
247class RemunerationROInline(ReadOnlyInlineMixin, RemunerationInline):
248 pass
249
250
251class TypePosteInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
252 model = rh.TypePoste
253
254
6f037929
OL
255class PosteComparaisonInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
256 model = rh.PosteComparaison
257
53ae644d
OL
258
259class ClassementAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 260 list_display = ('_classement', '_date_modification', 'user_modification', )
53ae644d
OL
261 fieldsets = AUFMetadataAdminMixin.fieldsets + (
262 (None, {
22343fe7 263 'fields': ('type', 'echelon', 'degre', 'coefficient',)}),
53ae644d
OL
264 )
265
c5964dc2
OL
266 def _classement(self, obj):
267 return unicode(obj)
268 _classement.short_description = u"Classement"
53ae644d 269
33232787 270 def _date_modification(self, obj):
22343fe7
OL
271 return date(obj.date_modification) \
272 if obj.date_modification is not None else "(aucune)"
33232787
JPC
273 _date_modification.short_description = u'date modification'
274 _date_modification.admin_order_field = 'date_modification'
275
22343fe7 276
53ae644d
OL
277class CommentaireAdmin(admin.ModelAdmin):
278 pass
279
280
7ba822a6 281class DeviseAdmin(AUFMetadataAdminMixin, admin.ModelAdmin, ArchiveMixin):
22343fe7
OL
282 list_display = (
283 'code',
284 'nom',
285 '_archive',
286 '_date_modification',
287 'user_modification',
288 )
edb35076 289 list_filter = ('archive', )
53ae644d
OL
290 fieldsets = AUFMetadataAdminMixin.fieldsets + (
291 (None, {
edb35076 292 'fields': ('code', 'nom', 'archive', ),
53ae644d
OL
293 }),
294 )
295
33232787 296 def _date_modification(self, obj):
22343fe7
OL
297 return date(obj.date_modification) \
298 if obj.date_modification is not None else "(aucune)"
33232787
JPC
299 _date_modification.short_description = u'date modification'
300 _date_modification.admin_order_field = 'date_modification'
53ae644d 301
22343fe7
OL
302
303class DossierAdmin(DateRangeMixin, AUFMetadataAdminMixin, \
304 ProtectRegionMixin, admin.ModelAdmin, AjaxSelect,):
53ae644d 305 alphabet_filter = 'employe__nom'
22343fe7 306 search_fields = (
35cff4a7
EMS
307 'id',
308 'employe__id',
309 'poste__id',
310 'employe__nom',
311 'employe__prenom',
312 'poste__nom',
313 'poste__nom_feminin',
314 'poste__implantation__nom',
315 )
53ae644d
OL
316 list_display = (
317 '_id',
e49ac947
JPC
318 '_apercu',
319 '_nom',
53ae644d
OL
320 '_poste',
321 '_employe',
322 '_date_debut',
323 '_date_fin',
33232787 324 '_date_modification',
c5964dc2 325 'user_modification',
a47ed016 326 '_dae',
53ae644d 327 )
e49ac947 328 list_display_links = ('_nom',)
53ae644d
OL
329 list_filter = (
330 'poste__implantation__region',
331 'poste__implantation',
7bf28694 332 'poste__type_poste__categorie_emploi',
7baa5523 333 'poste__type_poste',
53ae644d 334 'rh_contrats__type_contrat',
6bee05ff 335 'principal',
53ae644d
OL
336 )
337 inlines = (DossierPieceInline, ContratInline,
338 RemunerationInline,
53ae644d
OL
339 DossierCommentaireInline,
340 )
341 fieldsets = AUFMetadataAdminMixin.fieldsets + (
342 (None, {
22343fe7
OL
343 'fields': (
344 'employe',
345 'poste',
6bee05ff 346 'principal',
22343fe7
OL
347 'statut',
348 'organisme_bstg',)}),
53ae644d 349 ('Recrutement', {
22343fe7
OL
350 'fields': (
351 'statut_residence',
352 'remplacement',
353 'remplacement_de', )}),
53ae644d 354 ('Rémunération', {
22343fe7
OL
355 'fields': (
356 'classement',
357 ('regime_travail', 'regime_travail_nb_heure_semaine'),)}),
53ae644d 358 ('Occupation du Poste par cet Employe', {
22343fe7
OL
359 'fields': (('date_debut', 'date_fin'), )}
360 ),
53ae644d 361 )
22343fe7
OL
362 form = make_ajax_form(rh.Dossier, {
363 'employe': 'employes',
364 'poste': 'postes',
365 'remplacement_de': 'dossiers',
6bee05ff 366 }, superclass=DossierForm)
53ae644d
OL
367
368 def lookup_allowed(self, key, value):
369 if key in (
370 'employe__nom__istartswith',
53ae644d
OL
371 'poste__implantation__region__id__exact',
372 'poste__implantation__id__exact',
373 'poste__type_poste__id__exact',
7bf28694 374 'poste__type_poste__categorie_emploi__id__exact',
53ae644d 375 'rh_contrats__type_contrat__id__exact',
6bee05ff
OL
376 'principal__exact',
377 'principal__isnull',
53ae644d
OL
378 ):
379 return True
380
e49ac947
JPC
381 def _id(self, obj):
382 return obj.id
383 _id.short_description = u"#"
384 _id.admin_order_field = "id"
385
386 def _nom(self, obj):
22343fe7
OL
387 return "%d : %s %s" % (
388 obj.date_debut.year,
389 obj.employe.nom.upper(),
390 obj.employe.prenom)
e49ac947
JPC
391 _nom.allow_tags = True
392 _nom.short_description = u"Dossier"
393
e49ac947 394 def _apercu(self, d):
22343fe7
OL
395 apercu_link = u"""<a title="Aperçu du dossier"
396 onclick="return showAddAnotherPopup(this);"
397 href='%s'>
398 <img src="%simg/loupe.png" />
399 </a>""" % \
b10920ea 400 (reverse('dossier_apercu', args=(d.id,)),
822a2c33 401 settings.STATIC_URL,
b10920ea 402 )
e49ac947
JPC
403 return apercu_link
404 _apercu.allow_tags = True
405 _apercu.short_description = u""
53ae644d 406
a47ed016
OL
407 def _dae(self, d):
408 apercu_link = ""
de151a1e
EMS
409 dossiers_dae = d.dossiers_dae.all()
410 if len(dossiers_dae) > 0:
411 dossier_dae = dossiers_dae[0]
a47ed016
OL
412 apercu_link = u"""<a title="Aperçu du dossier"
413 onclick="return showAddAnotherPopup(this);"
414 href='%s'>
415 <img src="%simg/loupe.png" />
416 </a>""" % \
de151a1e 417 (reverse('embauche_consulter', args=(dossier_dae.id,)),
a47ed016
OL
418 settings.STATIC_URL,
419 )
420 return apercu_link
421 _dae.allow_tags = True
422 _dae.short_description = u"DAE"
423
53ae644d 424 def _date_debut(self, obj):
5f36f262
OL
425 return date(obj.date_debut)
426
53ae644d
OL
427 _date_debut.short_description = u'Occupation début'
428 _date_debut.admin_order_field = 'date_debut'
429
430 def _date_fin(self, obj):
5f36f262 431 return date(obj.date_fin)
53ae644d
OL
432 _date_fin.short_description = u'Occupation fin'
433 _date_fin.admin_order_field = 'date_fin'
434
33232787 435 def _date_modification(self, obj):
22343fe7
OL
436 return date(obj.date_modification) \
437 if obj.date_modification is not None else "(aucune)"
33232787
JPC
438 _date_modification.short_description = u'date modification'
439 _date_modification.admin_order_field = 'date_modification'
440
53ae644d 441 def _poste(self, dossier):
22343fe7
OL
442 link = u"""<a title="Aperçu du poste"
443 onclick="return showAddAnotherPopup(this);"
444 href='%s'><img src="%simg/loupe.png" />
445 </a>
446 <a href="%s" title="Modifier le poste">%s</a>""" % \
53ae644d 447 (reverse('poste_apercu', args=(dossier.poste.id,)),
822a2c33 448 settings.STATIC_URL,
211a0e56
JPC
449 reverse('admin:rh_poste_change', args=(dossier.poste.id,)),
450 dossier.poste,
53ae644d
OL
451 )
452 return link
453 _poste.allow_tags = True
454 _poste.short_description = u'Poste'
455 _poste.admin_order_field = 'poste__nom'
456
457 def _employe(self, obj):
458 employe = obj.employe
459 view_link = reverse('employe_apercu', args=(employe.id,))
460 edit_link = reverse('admin:rh_employe_change', args=(employe.id,))
461
f614ca5c 462 style = ""
22343fe7
OL
463 view = u"""<a href="%s"
464 title="Aperçu l'employé"
465 onclick="return showAddAnotherPopup(this);">
466 <img src="%simg/loupe.png" />
467 </a>""" % (view_link, settings.STATIC_URL,)
e6c107de
JPC
468 return u"""%s<a href='%s' style="%s;">%s</a>""" % \
469 (view, edit_link, style, employe)
53ae644d 470 _employe.allow_tags = True
e49ac947 471 _employe.short_description = u"Employé"
53ae644d 472 _employe.admin_order_field = "employe__nom"
22343fe7 473
53ae644d
OL
474 def save_formset(self, request, form, formset, change):
475 instances = formset.save(commit=False)
476 for instance in instances:
477 if instance.__class__ == rh.DossierCommentaire:
478 instance.owner = request.user
02e69aa2 479 instance.date_creation = datetime.datetime.now()
53ae644d
OL
480 instance.save()
481
482
483class DossierPieceAdmin(admin.ModelAdmin):
484 pass
485
486
487class DossierCommentaireAdmin(admin.ModelAdmin):
488 pass
489
490
22343fe7
OL
491class EmployeAdmin(DateRangeMixin, AUFMetadataAdminMixin, \
492 ProtectRegionMixin, admin.ModelAdmin,):
7eb6b687 493 prefixe_recherche_temporelle = "rh_dossiers__"
53ae644d
OL
494 alphabet_filter = 'nom'
495 DEFAULT_ALPHABET = u'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
496 search_fields = ('id', 'nom', 'prenom', 'nom_affichage', )
497 ordering = ('nom', )
498 form = EmployeAdminForm
22343fe7
OL
499 list_display = (
500 '_id',
501 '_apercu',
502 '_nom',
503 '_dossiers_postes',
504 '_date_modification',
505 'user_modification',
506 )
e49ac947 507 list_display_links = ('_nom',)
22343fe7
OL
508 list_filter = (
509 'rh_dossiers__poste__implantation__region',
510 'rh_dossiers__poste__implantation',
511 'nb_postes',
512 )
53ae644d
OL
513 inlines = (AyantDroitInline,
514 DossierROInline,
515 EmployePieceInline,
516 EmployeCommentaireInline)
517 fieldsets = AUFMetadataAdminMixin.fieldsets + (
518 ('Identification', {
22343fe7
OL
519 'fields': (
520 ('nom', 'prenom'),
521 ('nom_affichage', 'genre'),
522 'nationalite',
523 'date_naissance',
524 )}
525 ),
53ae644d 526 ('Informations personnelles', {
22343fe7
OL
527 'fields': ('situation_famille', 'date_entree', )}
528 ),
89a8df07 529 ('Coordonnées personnelles', {
22343fe7
OL
530 'fields': (
531 ('tel_domicile', 'tel_cellulaire'),
532 ('adresse', 'ville'),
533 ('code_postal', 'province'),
534 'pays',
89a8df07 535 'courriel_perso'
22343fe7
OL
536 )}
537 ),
53ae644d
OL
538 )
539
b10920ea 540 def _apercu(self, obj):
22343fe7
OL
541 return u"""<a title="Aperçu de l'employé"
542 onclick="return showAddAnotherPopup(this);"
543 href='%s'>
544 <img src="%simg/loupe.png" />
545 </a>""" % \
546 (reverse('employe_apercu', args=(obj.id,)), settings.STATIC_URL)
b10920ea
JPC
547 _apercu.allow_tags = True
548 _apercu.short_description = u""
b10920ea 549
53ae644d 550 def _nom(self, obj):
53ae644d 551 edit_link = reverse('admin:rh_employe_change', args=(obj.id,))
e6c107de 552 return u"""<a href='%s'><strong>%s</strong></a>""" % \
e49ac947 553 (edit_link, "%s %s" % (obj.nom.upper(), obj.prenom))
53ae644d 554 _nom.allow_tags = True
e49ac947 555 _nom.short_description = u"Employé"
53ae644d
OL
556 _nom.admin_order_field = "nom"
557
e49ac947
JPC
558 def _id(self, obj):
559 return obj.id
560 _id.short_description = u"#"
561 _id.admin_order_field = "id"
562
33232787 563 def _date_modification(self, obj):
22343fe7
OL
564 return date(obj.date_modification) \
565 if obj.date_modification is not None else "(aucune)"
33232787
JPC
566 _date_modification.short_description = u'date modification'
567 _date_modification.admin_order_field = 'date_modification'
568
a7f013f5 569 def _dossiers_postes(self, obj):
53ae644d
OL
570 l = []
571 for d in obj.rh_dossiers.all().order_by('-date_debut'):
22343fe7
OL
572 dossier = u"""<a title="Aperçu du dossier"
573 href="%s"
574 onclick="return showAddAnotherPopup(this);"
575 title="Aperçu du dossier">
576 <img src="%simg/loupe.png" />
577 </a>
578 <a href="%s">Dossier</a>
579 &nbsp;""" % \
580 (reverse('dossier_apercu', args=(d.id,)),
581 settings.STATIC_URL,
582 reverse('admin:rh_dossier_change', args=(d.id,)))
583
584 poste = u"""<a title="Aperçu du poste"
585 href="%s"
586 onclick="return showAddAnotherPopup(this);"
587 title="Aperçu du poste">
588 <img src="%simg/loupe.png" />
589 </a>
590 <a href="%s">Poste</a>
591 &nbsp;""" % \
592 (reverse('poste_apercu', args=(d.poste.id,)),
593 settings.STATIC_URL,
594 reverse('admin:rh_poste_change', args=(d.poste.id,)))
a7f013f5
JPC
595 link = u"""<li>%s %s - %s : [%s] %s</li>""" % \
596 (dossier, poste,
53ae644d 597 d.date_debut.year,
a7f013f5
JPC
598 d.poste.id,
599 d.poste.nom,
53ae644d 600 )
b5cc0357
OL
601
602 # Dossier terminé en gris non cliquable
a4329fae 603 if d.date_fin is not None and d.date_fin < datetime.date.today():
a7f013f5 604 link = u"""<li style="color: grey">%s : [%s] %s</li>""" % \
b5cc0357 605 (d.date_debut.year,
a7f013f5
JPC
606 d.poste.id,
607 d.poste.nom,
b5cc0357
OL
608 )
609
53ae644d
OL
610 l.append(link)
611 return "<ul>%s</ul>" % "\n".join(l)
a7f013f5
JPC
612 _dossiers_postes.allow_tags = True
613 _dossiers_postes.short_description = u"Dossiers et postes"
53ae644d
OL
614
615 def queryset(self, request):
22343fe7 616 qs = super(EmployeAdmin, self).queryset(request)
53ae644d
OL
617 return qs.select_related(depth=1).order_by('nom')
618
619 def save_formset(self, request, form, formset, change):
620 instances = formset.save(commit=False)
621 for instance in instances:
622 if instance.__class__ == rh.EmployeCommentaire:
623 instance.owner = request.user
02e69aa2 624 instance.date_creation = datetime.datetime.now()
53ae644d
OL
625 instance.save()
626
22343fe7 627
08faf06e 628class EmployeProxyAdmin(EmployeAdmin):
22343fe7 629 list_display = ('_id', '_apercu', '_nom', '_organigramme')
bd917a45
JPC
630 actions = None
631
632 def __init__(self, *args, **kwargs):
633 super(EmployeProxyAdmin, self).__init__(*args, **kwargs)
634 self.list_display_links = (None, )
08faf06e 635
22343fe7
OL
636 def has_add_permission(self, obj):
637 return False
638
08faf06e
JPC
639 def _organigramme(self, obj):
640 l = []
fc4bf968
EMS
641 for d in rh.Dossier.objects.filter(
642 Q(date_fin__gt=datetime.date.today()) | Q(date_fin=None),
643 Q(date_debut__lt=datetime.date.today()) | Q(date_debut=None),
644 employe=obj.id
645 ):
646 organigramme = \
647 u'Organigramme, niveau: ' \
648 u'<input type="text" id="level_%s" ' \
649 u'style="width:30px;height:15px;" /> ' \
650 u'<input type="button" value="Générer" ' \
651 u"""onclick="window.location='%s' + """ \
652 u"""document.getElementById('level_%s').value" />""" % (
653 d.poste.id,
654 reverse('rho_employe_sans_niveau', args=(d.poste.id,)),
655 d.poste.id
656 )
657 link = u"""<li>%s - [%s] %s : %s</li>""" % (
658 d.date_debut.year,
659 d.poste.id,
660 d.poste.nom,
661 organigramme
662 )
08faf06e
JPC
663 l.append(link)
664 return "<ul>%s</ul>" % "\n".join(l)
665
666 _organigramme.allow_tags = True
667 _organigramme.short_description = "Organigramme"
668
53ae644d 669
53ae644d
OL
670class EmployeCommentaireAdmin(admin.ModelAdmin):
671 pass
672
673
674class EmployePieceAdmin(admin.ModelAdmin):
675 pass
676
677
7bf28694 678class CategorieEmploiAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 679 list_display = ('nom', '_date_modification', 'user_modification', )
53ae644d 680 inlines = (TypePosteInline,)
22343fe7
OL
681 fieldsets = AUFMetadataAdminMixin.fieldsets + (
682 (None, {'fields': ('nom', )}),)
53ae644d 683
33232787 684 def _date_modification(self, obj):
22343fe7
OL
685 return date(obj.date_modification) \
686 if obj.date_modification is not None else "(aucune)"
33232787
JPC
687 _date_modification.short_description = u'date modification'
688 _date_modification.admin_order_field = 'date_modification'
53ae644d 689
22343fe7 690
95b630cf 691class OrganismeBstgAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 692 search_fields = ('nom',)
22343fe7
OL
693 list_display = (
694 'nom',
695 'type',
696 'pays',
697 '_date_modification',
698 'user_modification',
699 )
c5964dc2 700 list_filter = ('type', )
53ae644d 701 inlines = (DossierROInline,)
22343fe7
OL
702 fieldsets = AUFMetadataAdminMixin.fieldsets + (
703 (None, {'fields': ('nom', 'type', 'pays',)}),
53ae644d
OL
704 )
705
33232787 706 def _date_modification(self, obj):
22343fe7
OL
707 return date(obj.date_modification) \
708 if obj.date_modification is not None else "(aucune)"
33232787
JPC
709 _date_modification.short_description = u'date modification'
710 _date_modification.admin_order_field = 'date_modification'
711
53ae644d 712
22343fe7
OL
713class PosteAdmin(DateRangeMixin, AUFMetadataAdminMixin, \
714 ProtectRegionMixin, admin.ModelAdmin, AjaxSelect,):
715 form = make_ajax_form(rh.Poste, {
716 'implantation': 'implantations',
717 'type_poste': 'typepostes',
718 'responsable': 'postes',
719 'valeur_point_min': 'valeurpoints',
720 'valeur_point_max': 'valeurpoints',
53ae644d
OL
721 })
722 alphabet_filter = 'nom'
22343fe7 723 search_fields = (
397bf8dd 724 'id',
22343fe7 725 'nom',
22343fe7
OL
726 'implantation__nom',
727 'implantation__region__code',
728 'implantation__region__nom',
729 'rh_dossiers__employe__nom',
730 'rh_dossiers__employe__prenom',
731 )
53ae644d 732 list_display = (
e49ac947 733 '_id',
8f3ca727 734 '_apercu',
22343fe7 735 '_nom',
53ae644d 736 '_occupe_par',
22343fe7
OL
737 'implantation',
738 '_service',
1ce2ddb9 739 '_responsable',
352fa696 740 'date_debut',
53ae644d 741 'date_fin',
33232787 742 '_date_modification',
53ae644d 743 'user_modification',
a47ed016 744 '_dae',
53ae644d 745 )
f614ca5c 746 list_filter = (
22343fe7 747 'implantation__region',
53ae644d 748 'implantation',
22343fe7 749 'service',
53ae644d 750 'type_poste',
7bf28694 751 'type_poste__categorie_emploi',
118efe7a 752 'type_poste__famille_professionnelle',
4c53dda4 753 'vacant',
53ae644d 754 )
e49ac947 755 list_display_links = ('_nom',)
53ae644d 756 fieldsets = AUFMetadataAdminMixin.fieldsets + (
22343fe7
OL
757 (None, {'fields': (
758 ('nom', 'nom_feminin'),
759 'implantation',
760 'type_poste',
761 'service',
762 'responsable',
763 )}
764 ),
53ae644d 765 ('Contrat', {
22343fe7
OL
766 'fields': ((
767 'regime_travail',
768 'regime_travail_nb_heure_semaine'),
769 )}
770 ),
53ae644d 771 ('Recrutement', {
22343fe7
OL
772 'fields': (('local', 'expatrie', 'mise_a_disposition', 'appel'),)}
773 ),
53ae644d 774 ('Rémunération', {
22343fe7
OL
775 'fields': (('classement_min',
776 'valeur_point_min',
777 'devise_min',
778 'salaire_min',
779 'indemn_min',
780 'autre_min',),
781 ('classement_max',
782 'valeur_point_max',
783 'devise_max',
784 'salaire_max',
785 'indemn_max',
786 'autre_max',),
787 )}),
53ae644d
OL
788 ('Comparatifs de rémunération', {
789 'fields': ('devise_comparaison',
790 ('comp_locale_min', 'comp_locale_max'),
791 ('comp_universite_min', 'comp_universite_max'),
792 ('comp_fonctionpub_min', 'comp_fonctionpub_max'),
793 ('comp_ong_min', 'comp_ong_max'),
22343fe7
OL
794 ('comp_autre_min', 'comp_autre_max'))}
795 ),
53ae644d 796 ('Justification', {
22343fe7
OL
797 'fields': ('justification',)}
798 ),
48a6df80 799 ('Autres Méta-données', {
22343fe7
OL
800 'fields': ('date_debut', 'date_fin')}
801 ),
53ae644d
OL
802 )
803
804 inlines = (PosteFinancementInline,
805 PostePieceInline,
806 DossierROInline,
6f037929 807 PosteComparaisonInline,
53ae644d
OL
808 PosteCommentaireInline, )
809
f614ca5c 810 def lookup_allowed(self, key, value):
118efe7a
EMS
811 return key in (
812 'date_debut__gte', 'date_debut__isnull', 'date_fin__lte',
813 'date_fin__isnull', 'implantation__region__id__exact',
814 'implantation__id__exact', 'type_poste__id__exact',
815 'type_poste__categorie_emploi__id__exact', 'service__id__exact',
816 'service__isnull', 'vacant__exact', 'vacant__isnull',
817 ) or super(PosteAdmin, self).lookup_allowed(key, value)
f614ca5c 818
8f3ca727 819 def _apercu(self, poste):
22343fe7
OL
820 view_link = u"""<a onclick="return showAddAnotherPopup(this);"
821 title="Aperçu du poste"
822 href='%s'>
823 <img src="%simg/loupe.png" />
824 </a>""" % \
8f3ca727 825 (reverse('poste_apercu', args=(poste.id,)),
22343fe7
OL
826 settings.STATIC_URL,)
827 return view_link
8f3ca727 828 _apercu.allow_tags = True
e49ac947
JPC
829 _apercu.short_description = ''
830
a47ed016
OL
831 def _dae(self, poste):
832 apercu_link = ""
de151a1e
EMS
833 postes_dae = poste.postes_dae.all()
834 if len(postes_dae) > 0:
835 poste_dae = postes_dae[0]
836 apercu_link = \
837 u'<a title="Aperçu du dossier" href="%s" ' \
838 u'onclick="return showAddAnotherPopup(this);">' \
839 u'<img src="%simg/loupe.png" /></a>' % (reverse(
840 'poste_consulter', args=("dae-%s" % poste_dae.id,)
841 ), settings.STATIC_URL)
a47ed016
OL
842 return apercu_link
843 _dae.allow_tags = True
844 _dae.short_description = u"DAE"
845
e49ac947
JPC
846 def _id(self, obj):
847 return "%s" % obj.id
848 _id.short_description = '#'
849 _id.admin_order_field = 'id'
8f3ca727 850
c5964dc2 851 def _service(self, obj):
1b130b25
JPC
852 if obj.service.supprime:
853 return """<span style="color:red">%s</span>""" % obj.service
854 else:
855 return obj.service
6c2b1160 856 _service.short_description = 'Service'
1b130b25 857 _service.allow_tags = True
53ae644d 858
1ce2ddb9
JPC
859 def _responsable(self, obj):
860 try:
22343fe7
OL
861 responsable = u"""<a href="%s"
862 onclick="return showAddAnotherPopup(this)">
863 <img src="%simg/loupe.png"
864 title="Aperçu du poste" />
865 </a>
866 <a href="%s">%s</a>
867 <br />""" % \
868 (reverse('poste_apercu', args=(obj.responsable.id,)),
869 settings.STATIC_URL,
870 reverse('admin:rh_poste_change', args=(obj.responsable.id,)),
871 obj.responsable.nom)
1ce2ddb9
JPC
872 except:
873 responsable = ''
874
875 try:
fc4bf968 876 employe = obj.responsable.rh_dossiers.all()[0]
1ce2ddb9 877 employe_id = obj.responsable.rh_dossiers.all()[0].id
fc4bf968 878 employe_html = u"""<br />
22343fe7
OL
879 <a href="%s"
880 onclick="return showAddAnotherPopup(this)">
881 <img src="%simg/loupe.png"
882 title="Aperçu de l'employé">
883 </a>
884 <a href="%s">%s</a>""" % \
885 (reverse('employe_apercu', args=(employe_id,)),
886 settings.STATIC_URL,
887 reverse('admin:rh_employe_change', args=(employe_id,)),
888 employe)
1ce2ddb9 889 except:
fc4bf968 890 employe_html = ""
1ce2ddb9 891
fc4bf968 892 return "%s %s" % (responsable, employe_html)
1ce2ddb9
JPC
893 _responsable.short_description = 'Responsable'
894 _responsable.allow_tags = True
895
53ae644d 896 def _nom(self, poste):
e49ac947
JPC
897 return """<a href="%s">%s</a>""" % \
898 (reverse('admin:rh_poste_change', args=(poste.id,)),
22343fe7 899 poste.nom)
53ae644d
OL
900 _nom.allow_tags = True
901 _nom.short_description = u'Nom'
902 _nom.admin_order_field = 'nom'
903
33232787
JPC
904 def _date_modification(self, obj):
905 return date(obj.date_modification)
906 _date_modification.short_description = u'date modification'
907 _date_modification.admin_order_field = 'date_modification'
908
53ae644d
OL
909 def _occupe_par(self, obj):
910 """Formatte la méthode Poste.occupe_par() pour l'admin"""
15c5f55a 911 output = u"Vacant"
ae5d7df3 912 if obj.date_fin is not None and obj.date_fin < datetime.date.today():
954ead19 913 return u"s/o"
53ae644d
OL
914 employes = obj.occupe_par()
915 if employes:
916 l = []
917 for e in employes:
22343fe7
OL
918 link = u"""<a href='%s'
919 title='Aperçu de l\'employer'
920 onclick='return showAddAnotherPopup(this)'>
921 <img src='%simg/loupe.png' />
922 </a>
923 <a href='%s'>%s</a>""" % \
b10920ea 924 (reverse('employe_apercu', args=(e.id,)),
822a2c33 925 settings.STATIC_URL,
b10920ea 926 reverse('admin:rh_employe_change', args=(e.id,)),
22343fe7 927 e)
53ae644d
OL
928 l.append(link)
929 output = "\n<br />".join(l)
930 return output
931 _occupe_par.allow_tags = True
22343fe7 932 _occupe_par.short_description = "Occupé par"
53ae644d
OL
933
934 def save_formset(self, request, form, formset, change):
935 instances = formset.save(commit=False)
936 for instance in instances:
937 if instance.__class__ == rh.PosteCommentaire:
938 instance.owner = request.user
02e69aa2 939 instance.date_creation = datetime.datetime.now()
53ae644d
OL
940 instance.save()
941 formset.save_m2m()
942
943
944class PosteCommentaireAdmin(admin.ModelAdmin):
945 pass
946
947
948class PosteFinancementAdmin(admin.ModelAdmin):
949 pass
950
951
952class PostePieceAdmin(admin.ModelAdmin):
953 fk_name = 'poste'
954
955
956class RemunerationAdmin(admin.ModelAdmin):
957 pass
958
959
8c8ffc4f
OL
960class ResponsableInline(admin.TabularInline):
961 model = rh.ResponsableImplantation
962 extra = 0
fc4bf968
EMS
963 fk_name = "implantation"
964
22343fe7 965
8c8ffc4f
OL
966class ResponsableImplantationAdmin(admin.ModelAdmin):
967 actions = None
968 list_filter = ('region', 'statut', )
969 list_display = ('nom', 'statut', '_responsable', )
970 readonly_fields = ('nom', )
971 fields = ('nom', )
972 inlines = (ResponsableInline, )
973
974 def _responsable(self, obj):
975 try:
976 employe = obj.responsable.employe
977 dossiers = employe.dossiers_encours()
978 if len(dossiers) == 0:
979 return u"<span style='color: red;'>%s %s </span>" % (
980 employe, u"sans dossier actif")
981 else:
982 return employe
fc4bf968
EMS
983 except Exception:
984 if obj.statut in (1, 2): # ouverte, ouverture imminente
8c8ffc4f
OL
985 css = "style='color: red;'"
986 else:
987 css = ""
988 return u"<span %s>Pas de responsable</span>" % css
989 _responsable.allow_tags = True
990 _responsable.short_description = u"Responsable"
991
992 def has_add_permission(self, request=None):
993 return False
994
995 def has_change_permission(self, request, obj=None):
996 return in_drh_or_admin(request.user)
997
998 def has_delete_permission(self, request, obj=None):
999 return False
53ae644d 1000
fc4bf968 1001
7ba822a6 1002class ServiceAdmin(AUFMetadataAdminMixin, admin.ModelAdmin, ArchiveMixin):
22343fe7
OL
1003 list_display = (
1004 'nom',
1005 '_archive',
1006 '_date_modification',
1007 'user_modification',
1008 )
cbb0373e 1009 list_filter = ('archive', )
22343fe7 1010 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d 1011 (None, {
cbb0373e 1012 'fields': ('nom', 'archive', ),
53ae644d
OL
1013 }),
1014 )
1015
33232787 1016 def _date_modification(self, obj):
22343fe7
OL
1017 return date(obj.date_modification) \
1018 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1019 _date_modification.short_description = u'date modification'
1020 _date_modification.admin_order_field = 'date_modification'
1021
fc4bf968 1022
5c0f1778 1023class ServiceProxyAdmin(ServiceAdmin):
cfd5ac68 1024 list_display = ('nom', '_organigramme', '_archive', )
8135fc65
JPC
1025 actions = None
1026
1027 def __init__(self, *args, **kwargs):
1028 super(ServiceProxyAdmin, self).__init__(*args, **kwargs)
1029 self.list_display_links = (None, )
5c0f1778 1030
f7badf51
EMS
1031 def queryset(self, request):
1032 return super(ServiceProxyAdmin, self).queryset(request) \
1033 .annotate(num_postes=Count('rh_postes')) \
1034 .filter(num_postes__gt=0)
1035
5c0f1778
JPC
1036 def has_add_permission(self, obj):
1037 return False
1038
aa2c508e
JPC
1039 def has_change_permission(self, request, obj=None):
1040 return in_drh_or_admin(request.user)
1041
5c0f1778 1042 def _organigramme(self, obj):
8135fc65
JPC
1043 return """<a href="%s"><strong>Organigramme</strong></a>""" % \
1044 (reverse('rho_service', args=(obj.id,)))
5c0f1778
JPC
1045 _organigramme.allow_tags = True
1046 _organigramme.short_description = "Organigramme"
1047
8135fc65 1048
53ae644d 1049class StatutAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 1050 list_display = ('code', 'nom', '_date_modification', 'user_modification', )
22343fe7 1051 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1052 (None, {
1053 'fields': ('code', 'nom', ),
1054 }),
1055 )
1056
33232787 1057 def _date_modification(self, obj):
22343fe7
OL
1058 return date(obj.date_modification) \
1059 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1060 _date_modification.short_description = u'date modification'
1061 _date_modification.admin_order_field = 'date_modification'
1062
22343fe7 1063
53ae644d 1064class TauxChangeAdmin(admin.ModelAdmin):
22343fe7
OL
1065 list_display = (
1066 'taux',
1067 'devise',
1068 'annee',
1069 '_date_modification',
1070 'user_modification',
1071 )
53ae644d 1072 list_filter = ('devise', )
22343fe7 1073 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1074 (None, {
1075 'fields': ('taux', 'devise', 'annee', ),
1076 }),
1077 )
1078
33232787 1079 def _date_modification(self, obj):
22343fe7
OL
1080 return date(obj.date_modification) \
1081 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1082 _date_modification.short_description = u'date modification'
1083 _date_modification.admin_order_field = 'date_modification'
1084
22343fe7 1085
53ae644d 1086class TypeContratAdmin(admin.ModelAdmin):
22343fe7
OL
1087 list_display = (
1088 'nom',
1089 'nom_long',
1090 '_date_modification',
1091 'user_modification',
1092 )
1093 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1094 (None, {
1095 'fields': ('nom', 'nom_long', ),
1096 }),
1097 )
1098
33232787 1099 def _date_modification(self, obj):
22343fe7
OL
1100 return date(obj.date_modification) \
1101 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1102 _date_modification.short_description = u'date modification'
1103 _date_modification.admin_order_field = 'date_modification'
1104
53ae644d
OL
1105
1106class TypePosteAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
1107 search_fields = ('nom', 'nom_feminin', )
22343fe7
OL
1108 list_display = (
1109 'nom',
7bf28694 1110 'categorie_emploi',
22343fe7
OL
1111 '_date_modification',
1112 'user_modification',
1113 )
321fe481 1114 list_filter = ('categorie_emploi', 'famille_professionnelle')
22343fe7 1115 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d 1116 (None, {
22343fe7
OL
1117 'fields': (
1118 'nom',
1119 'nom_feminin',
1120 'is_responsable',
7bf28694 1121 'categorie_emploi',
321fe481 1122 'famille_professionnelle',
22343fe7
OL
1123 )}
1124 ),
53ae644d
OL
1125 )
1126
33232787 1127 def _date_modification(self, obj):
22343fe7
OL
1128 return date(obj.date_modification) \
1129 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1130 _date_modification.short_description = u'date modification'
1131 _date_modification.admin_order_field = 'date_modification'
1132
53ae644d 1133
fc4bf968
EMS
1134class TypeRemunerationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin,
1135 ArchiveMixin):
22343fe7
OL
1136 list_display = (
1137 'nom',
1138 'type_paiement',
1139 'nature_remuneration',
7ba822a6 1140 '_archive',
22343fe7
OL
1141 '_date_modification',
1142 'user_modification',)
7ba822a6 1143 list_filter = ('archive', )
22343fe7 1144 fieldsets = AUFMetadataAdminMixin.fieldsets + (
7ba822a6
OL
1145 (None, {'fields': ('nom', 'type_paiement', 'nature_remuneration',
1146 'archive')}),
53ae644d
OL
1147 )
1148
33232787 1149 def _date_modification(self, obj):
22343fe7
OL
1150 return date(obj.date_modification) \
1151 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1152 _date_modification.short_description = u'date modification'
1153 _date_modification.admin_order_field = 'date_modification'
1154
53ae644d
OL
1155
1156class TypeRevalorisationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 1157 list_display = ('nom', '_date_modification', 'user_modification', )
22343fe7
OL
1158 fieldsets = AUFMetadataAdminMixin.fieldsets + (
1159 (None, {'fields': ('nom', )}),
53ae644d
OL
1160 )
1161
33232787 1162 def _date_modification(self, obj):
22343fe7
OL
1163 return date(obj.date_modification) \
1164 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1165 _date_modification.short_description = u'date modification'
1166 _date_modification.admin_order_field = 'date_modification'
1167
53ae644d
OL
1168
1169class ValeurPointAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
22343fe7
OL
1170 list_display = (
1171 '_devise_code',
1172 '_devise_nom',
1173 'annee',
88202dc3 1174 'implantation',
22343fe7
OL
1175 'valeur',
1176 '_date_modification',
1177 'user_modification',
1178 )
88202dc3 1179 list_filter = ('annee', 'devise', 'implantation__region', )
22343fe7
OL
1180 fieldsets = AUFMetadataAdminMixin.fieldsets + (
1181 (None, {'fields': ('valeur', 'devise', 'implantation', 'annee', )}),
53ae644d
OL
1182 )
1183
33232787 1184 def _date_modification(self, obj):
22343fe7
OL
1185 return date(obj.date_modification) \
1186 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1187 _date_modification.short_description = u'date modification'
1188 _date_modification.admin_order_field = 'date_modification'
1189
53ae644d
OL
1190 def _devise_code(self, obj):
1191 return obj.devise.code
1192 _devise_code.short_description = "Code de la devise"
1193
1194 def _devise_nom(self, obj):
1195 return obj.devise.nom
1196 _devise_nom.short_description = "Nom de la devise"
1197
fc4bf968 1198
82af5c19
JPC
1199class ImplantationProxyAdmin(admin.ModelAdmin):
1200 list_display = ('nom', '_organigramme')
8135fc65
JPC
1201 actions = None
1202
1203 def __init__(self, *args, **kwargs):
1204 super(ImplantationProxyAdmin, self).__init__(*args, **kwargs)
1205 self.list_display_links = (None, )
82af5c19
JPC
1206
1207 def has_add_permission(self, obj):
1208 return False
1209
aa2c508e
JPC
1210 def has_change_permission(self, request, obj=None):
1211 return in_drh_or_admin(request.user)
1212
82af5c19 1213 def _organigramme(self, obj):
fc4bf968
EMS
1214 return '<a href="%s"><strong>Organigramme</strong></a>' % (
1215 reverse('rho_implantation', args=(obj.id,))
1216 )
82af5c19
JPC
1217 _organigramme.allow_tags = True
1218 _organigramme.short_description = "Organigramme"
1219
fc4bf968 1220
9da4c195
JPC
1221class RegionProxyAdmin(admin.ModelAdmin):
1222 list_display = ('nom', '_organigramme')
8135fc65
JPC
1223 actions = None
1224
1225 def __init__(self, *args, **kwargs):
1226 super(RegionProxyAdmin, self).__init__(*args, **kwargs)
1227 self.list_display_links = (None, )
9da4c195
JPC
1228
1229 def has_add_permission(self, obj):
1230 return False
1231
aa2c508e
JPC
1232 def has_change_permission(self, request, obj=None):
1233 return in_drh_or_admin(request.user)
1234
9da4c195 1235 def _organigramme(self, obj):
fc4bf968
EMS
1236 return """<a href="%s"><strong>Organigramme</strong></a>""" % (
1237 reverse('rho_region', args=(obj.id,))
1238 )
9da4c195
JPC
1239 _organigramme.allow_tags = True
1240 _organigramme.short_description = "Organigramme"
1241
1242
53ae644d
OL
1243admin.site.register(rh.Classement, ClassementAdmin)
1244admin.site.register(rh.Devise, DeviseAdmin)
1245admin.site.register(rh.Dossier, DossierAdmin)
22343fe7 1246admin.site.register(EmployeProxy, EmployeProxyAdmin)
5c0f1778 1247admin.site.register(ServiceProxy, ServiceProxyAdmin)
53ae644d 1248admin.site.register(rh.Employe, EmployeAdmin)
7bf28694 1249admin.site.register(rh.CategorieEmploi, CategorieEmploiAdmin)
321fe481 1250admin.site.register(rh.FamilleProfessionnelle)
53ae644d
OL
1251admin.site.register(rh.OrganismeBstg, OrganismeBstgAdmin)
1252admin.site.register(rh.Poste, PosteAdmin)
fc4bf968
EMS
1253admin.site.register(
1254 rh.ResponsableImplantationProxy, ResponsableImplantationAdmin
1255)
53ae644d 1256admin.site.register(rh.Service, ServiceAdmin)
c5964dc2 1257admin.site.register(rh.Statut, StatutAdmin)
53ae644d 1258admin.site.register(rh.TauxChange, TauxChangeAdmin)
c5964dc2 1259admin.site.register(rh.TypeContrat, TypeContratAdmin)
53ae644d
OL
1260admin.site.register(rh.TypePoste, TypePosteAdmin)
1261admin.site.register(rh.TypeRemuneration, TypeRemunerationAdmin)
1262admin.site.register(rh.TypeRevalorisation, TypeRevalorisationAdmin)
1263admin.site.register(rh.ValeurPoint, ValeurPointAdmin)
82af5c19 1264admin.site.register(ImplantationProxy, ImplantationProxyAdmin)
9da4c195 1265admin.site.register(RegionProxy, RegionProxyAdmin)