Historique plus explicite en cas de controle et de changement de nom
et de prenom. Par Stphane. darcs-hash:20051111112027-d1718-145f9e16be925067907d986a1958e15d4ec1b9f1.gz
This commit is contained in:
parent
179e003308
commit
9c996ca6b5
1 changed files with 26 additions and 7 deletions
|
@ -919,24 +919,43 @@ class base_classes_crans(crans_ldap):
|
||||||
modif='inscription'
|
modif='inscription'
|
||||||
else:
|
else:
|
||||||
### ON NE TOUCHE PAS A SELF.MODIFS, IL EST UTILISÉ PLUS LOIN !!!!!!!
|
### ON NE TOUCHE PAS A SELF.MODIFS, IL EST UTILISÉ PLUS LOIN !!!!!!!
|
||||||
modif=', '.join(self.modifs)
|
# Copie de la liste
|
||||||
|
modif = self.modifs[:]
|
||||||
|
|
||||||
if "chbre" in self.modifs:
|
if "chbre" in self.modifs:
|
||||||
modif = modif.replace('chbre', "chbre %s -> %s" % (self._init_data["chbre"][0],
|
modif[modif.index('chbre')] = "chbre %s -> %s" % (self._init_data["chbre"][0],
|
||||||
self._data["chbre"][0]))
|
self._data["chbre"][0])
|
||||||
|
|
||||||
if "solde" in self.modifs:
|
if "solde" in self.modifs:
|
||||||
diff = float(self._init_data.get('solde',[0])[0]) - float(self._data.get('solde',[0])[0])
|
diff = float(self._init_data.get('solde',[0])[0]) - float(self._data.get('solde',[0])[0])
|
||||||
if diff > 0:
|
if diff > 0:
|
||||||
modif = modif.replace("solde", "debit %s Euros" % str(diff) )
|
modif[modif.index('solde')] = "debit %s Euros" % str(diff)
|
||||||
else:
|
else:
|
||||||
modif = modif.replace("solde", "credit %s Euros" % str(-diff) )
|
modif[modif.index('solde')] = "credit %s Euros" % str(-diff)
|
||||||
|
|
||||||
if 'droits' in self.modifs:
|
if 'droits' in self.modifs:
|
||||||
anciens_droits = self._init_data.get('droits',[])
|
anciens_droits = self._init_data.get('droits',[])
|
||||||
nouveaux_droits = self._data.get('droits',[])
|
nouveaux_droits = self._data.get('droits',[])
|
||||||
droits_ajoutes = ''.join( [ '+%s' % decode(d) for d in nouveaux_droits if d not in anciens_droits ] )
|
droits_ajoutes = ''.join( [ '+%s' % decode(d) for d in nouveaux_droits if d not in anciens_droits ] )
|
||||||
droits_enleves = ''.join( [ '-%s' % decode(d) for d in anciens_droits if d not in nouveaux_droits ] )
|
droits_enleves = ''.join( [ '-%s' % decode(d) for d in anciens_droits if d not in nouveaux_droits ] )
|
||||||
modif = modif.replace("droits", "droits : " + droits_ajoutes + droits_enleves )
|
modif[modif.index('droits')] = "droits : " + droits_ajoutes + droits_enleves
|
||||||
|
|
||||||
|
if 'controle' in self.modifs:
|
||||||
|
ancien = (self._init_data.get('controle') or [''])[0]
|
||||||
|
nouveau = (self._data.get('controle') or [''])[0]
|
||||||
|
plus = ''.join([ '+%s' % d for d in nouveau if d not in ancien ])
|
||||||
|
moins = ''.join([ '-%s' % d for d in ancien if d not in nouveau ])
|
||||||
|
modif[modif.index('controle')] = 'controle : ' + plus + moins
|
||||||
|
|
||||||
|
if 'nom' in self.modifs:
|
||||||
|
modif[modif.index('nom')] = 'nom %s -> %s' % (decode(self._init_data['nom'][0]),
|
||||||
|
decode(self._data['nom'][0]))
|
||||||
|
|
||||||
|
if 'prenom' in self.modifs:
|
||||||
|
modif[modif.index('prenom')] = 'prenom %s -> %s' % (decode(self._init_data['prenom'][0]),
|
||||||
|
decode(self._data['prenom'][0]))
|
||||||
|
|
||||||
|
modif = ', '.join(modif)
|
||||||
|
|
||||||
timestamp = localtime()
|
timestamp = localtime()
|
||||||
hist = "%s, %s" % ( time.strftime(date_format, timestamp), script_utilisateur )
|
hist = "%s, %s" % ( time.strftime(date_format, timestamp), script_utilisateur )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue