[intranet/impression] Ajout log imprimeur club
Ignore-this: 2662fa44212c256ce4208e4299eff7f8 darcs-hash:20121027234130-28565-07456e146bf5e083d090d726e4fbfce30cb4a9de.gz
This commit is contained in:
parent
ce443b9bfa
commit
5d25b023d8
3 changed files with 11 additions and 3 deletions
|
@ -378,10 +378,13 @@ class impression:
|
|||
|
||||
# debite l'adhérent si adherent il y a
|
||||
if (self._adh != None):
|
||||
adh = self._get_adh(self._adh)
|
||||
adh = self._adh.split('@')
|
||||
if len(adh) > 1:
|
||||
adh = adh[1:]
|
||||
adh = self._get_adh(adh[0])
|
||||
if (self._prix > (adh.solde() - DECOUVERT_AUTHORISE)):
|
||||
raise SoldeInsuffisant
|
||||
adh.solde(-self._prix, "impression(%d): %s" % (self._jid,self._fichier))
|
||||
adh.solde(-self._prix, "impression(%d): %s par %s" % (self._jid,self._fichier,self._adh))
|
||||
adh.save()
|
||||
del adh
|
||||
# imprime le document
|
||||
|
|
|
@ -170,6 +170,7 @@ def verifLogin(login = '', password = ''):
|
|||
cherrypy.session['uid'] = login_club
|
||||
cherrypy.session['droits'] = []
|
||||
cherrypy.session['estClub'] = True
|
||||
cherrypy.session['adh_uid'] = login
|
||||
else:
|
||||
cherrypy.session['uid'] = login
|
||||
cherrypy.session['droits'] = adh.droits()
|
||||
|
|
|
@ -50,6 +50,7 @@ def fmt_exc(e):
|
|||
# #############################################################
|
||||
class threadedImpression(Thread, impression):
|
||||
def __init__(self, path_to_pdf, adh = None, callback = None):
|
||||
raise Exception('Code mort ')
|
||||
self.tpath_to_pdf = path_to_pdf
|
||||
self.tadh = adh
|
||||
Thread.__init__(self)
|
||||
|
@ -163,7 +164,10 @@ class main(ModuleBase):
|
|||
def useFile(self, fileName):
|
||||
try:
|
||||
filepath = os.path.join(os.path.join(FILE_UPLOAD_BASE_FOLDER, cherrypy.session['uid']+"/"), fileName)
|
||||
cherrypy.session['impression'] = impression(filepath, cherrypy.session['uid'])
|
||||
adh = cherrypy.session['uid']
|
||||
if cherrypy.session['estClub']:
|
||||
adh = cherrypy.session['adh_uid'] + '@' + adh
|
||||
cherrypy.session['impression'] = impression(filepath, adh)
|
||||
crans.cp.log("useFile returns: %s" % str( cherrypy.session['impression'].pages() ))
|
||||
return {'nbPages': cherrypy.session['impression'].pages()}
|
||||
except FichierInvalide, e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue