From 46d571dd7042c2009026958a363e6576e9e8d972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Wed, 18 Feb 2015 16:37:03 +0100 Subject: [PATCH] On permute dans la recherche les champs pour clubs et pour machines. --- gestion/gest_crans.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index 4552421f..977e0120 100755 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -2348,18 +2348,18 @@ def select(clas, quoi, mde=''): arg += u'"Chambre :" 5 1 "%s" 5 13 20 00 ' % s[3] arg += u'"aid :" 6 1 "%s" 6 13 20 5 ' % s[4] arg += u'"Mail :" 7 1 "%s" 7 13 20 00 ' % s[5] - arg += u'"Filtres machine" 1 40 "" 0 0 0 0 ' - arg += u'"Nom :" 2 37 "%s" 2 43 17 50 ' % s[6] - arg += u'"Mac :" 3 37 "%s" 3 43 17 17 ' % s[7] - arg += u'"IP :" 4 37 "%s" 4 43 17 40 ' % s[8] - arg += u'"mid :" 5 37 "%s" 5 43 17 5 ' % s[9] + arg += u'"Filtres clubs" 1 40 "" 0 0 0 0 ' + arg += u'"Nom :" 2 37 "%s" 2 46 20 30 ' % s[6] + arg += u'"Local :" 3 37 "%s" 3 46 20 00 ' % s[7] + arg += u'"cid :" 4 37 "%s" 4 46 20 5 ' % s[8] + arg += u'"Login :" 5 37 "%s" 5 46 20 00 ' % 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'"fid :" 7 37 "%s" 7 46 20 5 ' % s[10] + arg += u'"Filtres machine" 1 75 "" 0 0 0 0 ' + arg += u'"Nom :" 2 68 "%s" 2 77 20 50 ' % s[11] + arg += u'"Mac :" 3 68 "%s" 3 77 20 17 ' % s[12] + arg += u'"IP :" 4 68 "%s" 4 77 20 40 ' % s[13] + arg += u'"mid :" 5 68 "%s" 5 77 20 5 ' % s[14] arg += u'"Remarque : les champs vides sont ignorés." 8 1 "" 0 0 0 0' annul, result = dialog(arg) @@ -2384,9 +2384,9 @@ def select(clas, quoi, mde=''): ### Contruction de la chaîne de recherche 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_clubs = u'nom=%s&chbre=%s&cid=%s&uid=%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_machine = u'host=%s&macAddress=%s&ipHostNumber=%s&mid=%s&' % tuple(s[11:]) filtre = u'' if filtre_adher.count('=*&') != 6: @@ -2443,9 +2443,9 @@ def select(clas, quoi, mde=''): valid.append(a) elif quoi[-1] == 'm': valid = res['machine'] - 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 m in a.machines(): valid.append(m) elif quoi[-1] == 'f':