diff --git a/gestion/whos.py b/gestion/whos.py index 78a7f719..ed9a1e27 100755 --- a/gestion/whos.py +++ b/gestion/whos.py @@ -51,6 +51,7 @@ base = None from time import strftime, localtime, time from ldap_crans import is_actif, crans_ldap, ann_scol, AssociationCrans, hostname from ldap_crans import MachineWifi, BorneWifi +from ldap_crans import Adherent from affich_tools import * import user_tests import popen2, commands @@ -125,7 +126,8 @@ def adhers_brief(adhers) : if ann_scol in a.paiement(): if 'p' in a.controle(): paid = ook else: paid = ok - else : paid = nok + elif isinstance(a,Adherent) and not a.adherentPayant(): paid = coul('G', 'bleu') + else: paid = nok # Précablage if ann_scol+1 in a.paiement() : paid = coul(paid,'f_vert') @@ -156,7 +158,7 @@ def adhers_brief(adhers) : if len(adhers) <= limit_aff_machines: return u"Machines en rouge = machines avec limitation de services\n" + \ - u"P : paiement année en cours, le fond vert indique le précâblage\n" + \ + u"P : paiement année en cours, le fond vert indique le précâblage (G bleu = inscription gratuite)\n" + \ u"C : carte d'étudiant année en cours\n" + \ tableau(data, titre = [u'aid', u'Prénom Nom', u'Chbre', u'P', u'C', u'Machines'], @@ -164,7 +166,7 @@ def adhers_brief(adhers) : alignement = ['d', 'c', 'g', 'c', 'c', 'c']) else: return u"Machines en rouge = machines avec limitation de services\n" + \ - u"P : paiement année en cours, le fond vert indique le précâblage\n" + \ + u"P : paiement année en cours, le fond vert indique le précâblage (G bleu = inscription gratuite)\n" + \ u"C : carte d'étudiant année en cours\n" + \ tableau(data, titre = [u'aid', u'Prénom Nom', u'Chbre', u'P', u'C'], @@ -195,13 +197,16 @@ def machines_brief(machines) : p = a.Nom() # A jour administrativement - if ann_scol not in a.paiement() or ann_scol not in a.carteEtudiant() : - p = coul(p,'rouge') + if ann_scol not in a.paiement() or ann_scol not in a.carteEtudiant(): + if isinstance(a, Adherent) and not a.adherentPayant(): + p = coul(p, 'bleu') + else: + p = coul(p,'rouge') # Données data.append([m.id() , t, m.nom().split('.')[0], p, a.chbre(), bl]) - return u"Le propriétaire en rouge signale un problème administratif\n" + \ + return u"Le propriétaire en rouge signale un problème administratif, en bleu une inscription gratuite\n" + \ tableau(data, titre = [u'mid', u'Type', u'Nom de machine', u'Propriétaire', u'Chbre', u'Limitation'], largeur = [5, 4, 18, '*', 5, 10], @@ -406,8 +411,11 @@ def adher_details(adher) : jour = 0 if ann_scol not in adher.paiement() : if not jour : f += ' et ' - f += coul(u"cotisation %s/%d non réglée"% (ann_scol, ann_scol+1 ),'violet') - jour = 0 + if isinstance(adher, Adherent) and not adher.adherentPayant(): + f += coul(u"inscription gratuite", 'bleu') + else: + f += coul(u"cotisation %s/%d non réglée"% (ann_scol, ann_scol+1 ),'violet') + jour = 0 if jour : f += coul(u"à jour",'vert')