Commit 22c3d4eb authored by Pauline Pommeret's avatar Pauline Pommeret

Merge branch 'master' of git.crans.org:/git/usr-scripts

parents df21e43a e36ef4d3
......@@ -2317,7 +2317,7 @@ def select(clas, quoi, mde=''):
si m = ro ouvre l'objet en mode read-only
"""
s= ['', '', '', '', '', '', '', '', '', '', '']
s= ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
def unicodize(a):
try:
return unicode(a, 'utf-8')
......@@ -2342,6 +2342,11 @@ def select(clas, quoi, mde=''):
arg += u'"mid :" 5 37 "%s" 5 43 17 5 ' % s[9]
arg += u'"Filtres facture" 6 40 "" 0 0 0 0 '
arg += u'"fid :" 7 37 "%s" 7 43 17 5 ' % s[10]
arg += u'"Filtres clubs" 1 70 "" 0 0 0 0 '
arg += u'"Nom :" 2 64 "%s" 2 73 20 30 ' % s[11]
arg += u'"Local :" 3 64 "%s" 3 73 20 00 ' % s[12]
arg += u'"cid :" 4 64 "%s" 4 73 20 5 ' % s[13]
arg += u'"Login :" 5 64 "%s" 5 73 20 00 ' % s[14]
arg += u'"Remarque : les champs vides sont ignorés." 8 1 "" 0 0 0 0'
annul, result = dialog(arg)
......@@ -2365,10 +2370,10 @@ def select(clas, quoi, mde=''):
s[5] += '@crans.org'
### Contruction de la chaîne de recherche
print s
filtre_adher = u'nom=%s&prenom=%s&tel=%s&chbre=%s&aid=%s&mail=%s&' % tuple(s[:6])
filtre_machine = u'host=%s&macAddress=%s&ipHostNumber=%s&mid=%s&' % tuple(s[6:10])
filtre_facture = u'fid=%s&' % s[10]
filtre_clubs = u'nom=%s&chbre=%s&cid=%s&uid=%s&' % tuple(s[11:])
filtre = u''
if filtre_adher.count('=*&') != 6:
......@@ -2381,6 +2386,9 @@ def select(clas, quoi, mde=''):
if filtre_facture.count('=*&') != 1:
if filtre: filtre += '&'
filtre += filtre_facture[:-1]
if filtre_clubs.count('=*&') != 4:
if filtre: filtre += '&'
filtre += filtre_clubs[:-1]
if filtre == '':
# Aucune condion => erreur
arg = u'--title "Recherche" '
......@@ -2429,9 +2437,9 @@ def select(clas, quoi, mde=''):
valid.append(m)
elif quoi[-1] == 'f':
valid = res['facture']
if not valid and res['adherent']:
if not valid and (res['adherent'] or res['club']):
# On va récupérer les machines des adhérents trouvés
for a in res['adherent']:
for a in res['adherent'] + res['club']:
for f in a.factures():
valid.append(f)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment