search_fields = ('employe__nom', 'employe__prenom', 'poste__nom', 'poste__nom_feminin')
list_display = (
'_id',
+ '_apercu',
+ '_nom',
'_poste',
'_employe',
'_date_debut',
'_date_modification',
'user_modification',
)
+ list_display_links = ('_nom',)
list_filter = (
'poste__implantation__region',
'poste__implantation',
):
return True
- def _id(self, d):
+ def _id(self, obj):
+ return obj.id
+ _id.short_description = u"#"
+ _id.admin_order_field = "id"
+
+ def _nom(self, obj):
+ return "%d : %s %s" % \
+ (obj.date_debut.year, obj.employe.nom.upper(), obj.employe.prenom)
+ _nom.allow_tags = True
+ _nom.short_description = u"Dossier"
+
+
+ def _apercu(self, d):
apercu_link = u"""<a title="Aperçu du dossier" onclick="return showAddAnotherPopup(this);" href='%s'><img src="%simg/loupe.png" /></a>""" % \
(reverse('dossier_apercu', args=(d.id,)),
settings.STATIC_URL,
)
- link = u"""%s <a href="%s" title="Modifier le dossier"><strong>%s</strong></a>""" % \
- (apercu_link,
- reverse('admin:rh_dossier_change', args=(d.id,)),
- d.id,
- )
- return link
- _id.allow_tags = True
- _id.short_description = u"Dossier #"
- _id.admin_order_field = 'id'
+ return apercu_link
+ _apercu.allow_tags = True
+ _apercu.short_description = u""
def _date_debut(self, obj):
return u"""%s<a href='%s' style="%s;">%s</a>""" % \
(view, edit_link, style, employe)
_employe.allow_tags = True
- _employe.short_description = u"Employé (NOM Prénom [code])"
+ _employe.short_description = u"Employé"
_employe.admin_order_field = "employe__nom"
def save_formset(self, request, form, formset, change):
search_fields = ('id', 'nom', 'prenom', 'nom_affichage', )
ordering = ('nom', )
form = EmployeAdminForm
- list_display = ('_apercu', '_nom', '_dossiers', '_date_modification', 'user_modification', )
+ list_display = ('_id', '_apercu', '_nom', '_dossiers', '_date_modification', 'user_modification', )
+ list_display_links = ('_nom',)
list_filter = ('rh_dossiers__poste__implantation__region', 'rh_dossiers__poste__implantation', 'nb_postes', 'rh_dossiers__date_debut', 'rh_dossiers__date_fin')
date_borne_gauche = 'rh_dossiers__date_debut'
date_borne_droite = 'rh_dossiers__date_fin'
(reverse('employe_apercu', args=(obj.id,)), settings.STATIC_URL)
_apercu.allow_tags = True
_apercu.short_description = u""
- _apercu.admin_order_field = ""
def _nom(self, obj):
edit_link = reverse('admin:rh_employe_change', args=(obj.id,))
return u"""<a href='%s'><strong>%s</strong></a>""" % \
- (edit_link, obj)
+ (edit_link, "%s %s" % (obj.nom.upper(), obj.prenom))
_nom.allow_tags = True
- _nom.short_description = u"Employé (NOM Prénom [code])"
+ _nom.short_description = u"Employé"
_nom.admin_order_field = "nom"
+ def _id(self, obj):
+ return obj.id
+ _id.short_description = u"#"
+ _id.admin_order_field = "id"
+
def _date_modification(self, obj):
return date(obj.date_modification) if obj.date_modification is not None else "(aucune)"
_date_modification.short_description = u'date modification'
'rh_dossiers__employe__prenom',
)
list_display = (
+ '_id',
'_apercu',
'_nom',
'_occupe_par',
'date_fin',
'vacant',
)
+ list_display_links = ('_nom',)
fieldsets = AUFMetadataAdminMixin.fieldsets + (
(None, {
'fields': (('nom', 'nom_feminin'), 'implantation', 'type_poste',
(reverse('poste_apercu', args=(poste.id,)),
settings.STATIC_URL,
)
- edit_link = u"""<a href="%s" title="Modifier le poste"><strong>%s</strong></a>""" % \
- (reverse('admin:rh_poste_change', args=(poste.id,)),
- poste.id,
- )
- return view_link + edit_link
+ return view_link
_apercu.allow_tags = True
- _apercu.short_description = 'Poste __#'
- _apercu.admin_order_field = 'id'
+ _apercu.short_description = ''
+
+ def _id(self, obj):
+ return "%s" % obj.id
+ _id.short_description = '#'
+ _id.admin_order_field = 'id'
def _service(self, obj):
return obj.service
def _nom(self, poste):
- return poste.nom
+ return """<a href="%s">%s</a>""" % \
+ (reverse('admin:rh_poste_change', args=(poste.id,)),
+ poste.nom
+ )
_nom.allow_tags = True
_nom.short_description = u'Nom'
_nom.admin_order_field = 'nom'