Ajout d'un controle paiement et carte d'tudiant pour le trez
Fait par Stphane. darcs-hash:20051030235747-41617-d58682c07214caef5e2d9b94691f8ed6e2370b61.gz
This commit is contained in:
parent
7483b3f862
commit
1a6bbb2604
3 changed files with 85 additions and 19 deletions
|
@ -63,7 +63,7 @@ blacklist_items = { u'bloq' : u'Bloquage total de tout services' ,
|
|||
|
||||
##################################################################################
|
||||
### Droits possibles
|
||||
droits_possibles = [ u'Nounou', u'Apprenti', u'Modérateur', u'Câbleur', u'Déconnecteur', u'WebRadio' , u'Imprimeur', u'MultiMachines']
|
||||
droits_possibles = [ u'Nounou', u'Apprenti', u'Modérateur', u'Câbleur', u'Déconnecteur', u'WebRadio' , u'Imprimeur', u'MultiMachines', u'Contrôleur' ]
|
||||
|
||||
##################################################################################
|
||||
### Variables internes diverses
|
||||
|
@ -222,9 +222,9 @@ class crans_ldap:
|
|||
'club': [ 'nom', 'chbre' ] }
|
||||
|
||||
# Champs de recherche pour la recherche manuelle (en plus de la recherche auto)
|
||||
non_auto_search_champs = { 'adherent': [ 'etudes', 'paiement', 'carteEtudiant', 'aid' , 'postalAddress', 'historique' ,'blacklist', 'droits', 'uidNumber', 'uid', 'info', 'solde' ], \
|
||||
non_auto_search_champs = { 'adherent': [ 'etudes', 'paiement', 'carteEtudiant', 'aid' , 'postalAddress', 'historique' ,'blacklist', 'droits', 'uidNumber', 'uid', 'info', 'solde' , 'controle' ], \
|
||||
'machine': [ 'mid' , 'ipsec', 'historique', 'blacklist' , 'puissance', 'canal', 'portTCPin', 'portTCPout', 'portUDPin', 'portUDPout', 'prise' , 'info', 'exempt' ] ,
|
||||
'club': [ 'cid' , 'responsable', 'paiement', 'historique', 'blacklist', 'mailAlias', 'info'] }
|
||||
'club': [ 'cid' , 'responsable', 'paiement', 'historique', 'blacklist', 'mailAlias', 'info', 'controle' ] }
|
||||
|
||||
# Scope des différentes recherches
|
||||
scope = { 'adherent': 1 , 'machine': 2 , 'club': 1 }
|
||||
|
@ -1036,8 +1036,8 @@ class base_classes_crans(crans_ldap):
|
|||
|
||||
def _set(self,champ,val):
|
||||
""" Met à jour les données de data et modifie modifs si besoin """
|
||||
if not self._data.has_key(champ) \
|
||||
or self._data.has_key(champ) and self._data[champ]!=val:
|
||||
if (not self._data.has_key(champ) and val != []) \
|
||||
or (self._data.has_key(champ) and self._data[champ]!=val):
|
||||
self._data[champ]=val
|
||||
if champ not in self.modifs:
|
||||
self.modifs.append(champ)
|
||||
|
@ -1187,6 +1187,30 @@ class base_proprietaire(base_classes_crans):
|
|||
self._set('solde',[str(new)])
|
||||
return new
|
||||
|
||||
def controle(self,new=None):
|
||||
"""
|
||||
Controle du tresorier
|
||||
New est de la forme {+-}{pc}
|
||||
(p pour le paiement, c pour la carte
|
||||
Retourne une chaine contenant p ou c ou les deux
|
||||
"""
|
||||
actuel = self._data.get('controle',[''])[0]
|
||||
if new==None:
|
||||
return actuel
|
||||
|
||||
if not sre.match(r'^[+-][pc]$', new):
|
||||
raise ValueError('modification de controle incorrecte')
|
||||
|
||||
for c in 'pc':
|
||||
if new == '+%s' % c and c not in actuel:
|
||||
actuel += c
|
||||
if new == '-%s' % c:
|
||||
actuel = actuel.replace(c, '')
|
||||
|
||||
if actuel == '': self._set('controle',[])
|
||||
else: self._set('controle',[actuel])
|
||||
return actuel
|
||||
|
||||
def paiement(self,action=None):
|
||||
"""
|
||||
Action est un entier représentant une année
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue