Modifications de whos pour les inscriptions gratuites

darcs-hash:20080913111501-ffbb2-ce193551ac9e09b9ef1156b788a880e1b92105aa.gz
This commit is contained in:
Nicolas Dandrimont 2008-09-13 13:15:01 +02:00
parent 4ce8fcc001
commit 759c78b8c3

View file

@ -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() :
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,6 +411,9 @@ def adher_details(adher) :
jour = 0
if ann_scol not in adher.paiement() :
if not jour : f += ' et '
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