From dce073de67c45ee33da425224471c0f257edb1ea Mon Sep 17 00:00:00 2001 From: gdetrez Date: Thu, 16 Nov 2006 23:23:59 +0100 Subject: [PATCH] Modification pour ie. a marche presque... mais ie fait encore des trucs nuls... darcs-hash:20061116222359-f46e9-a7348bde89828fabf9bc2c40a5aafc0c52fed8c4.gz --- intranet/pages/impression.py | 9 ++-- intranet/templates/impression.tmpl | 70 ++++++++++++++---------------- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/intranet/pages/impression.py b/intranet/pages/impression.py index 63f9da12..f2e67d8a 100755 --- a/intranet/pages/impression.py +++ b/intranet/pages/impression.py @@ -20,13 +20,13 @@ class root: def index(self, submit = None, fileList = None, newFile = None ): data = {} cherrypy.session['impression'] = None - if submit == "submit_send": + if submit == "Envoyer": try: self.savePDF(newFile) data['fileName'] = newFile.filename except FileError, e: data['openError'] = e.args[0] - elif submit == "submit_chose": + elif submit == "Choisir": if (fileList): data['fileName'] = fileList else: @@ -92,8 +92,11 @@ class root: filepath = os.path.join(os.path.join(FILE_UPLOAD_BASE_FOLDER, cherrypy.session['uid']+"/"), fileName) cherrypy.session['impression'] = crans.impression.impression(filepath, cherrypy.session['uid']) return {'nbPages': cherrypy.session['impression'].pages()} + except crans.impression.FichierInvalide, e: + cherrypy.log("useFile : %s (%s)" % (str(e), e.file()), 'IMPRESSION', 1) + return {'erreur':str(e) } except Exception, e: - cherrypy.log("useFile (erreur): %s" % str(e), 'IMPRESSION', 1) + cherrypy.log("useFile : %s" % str(e), 'IMPRESSION', 1) return {'erreur':str(e) } useFile.exposed= True diff --git a/intranet/templates/impression.tmpl b/intranet/templates/impression.tmpl index 34b15977..6a6785a9 100644 --- a/intranet/templates/impression.tmpl +++ b/intranet/templates/impression.tmpl @@ -68,51 +68,45 @@
  • pages:

  • #end if -
  • Nouvelle impression
  • Mes codes
  • État imprimante:
    $etatImprimante
  • - #if not $getVar('Erreur_imprimante',False) - #if not $getVar('fileName',False) -
    -

    Impression - Choix fichier

    -
    - #if $getVar('openError',False) -
    $openError
    - #end if - -
    -

    Mes fichiers

    -
    - -
    -
    - -
    - -

    Envoyer un fichier

    -
    - - -
    -
    -
    -
    + #if not $getVar('fileName',False) +
    +

    Impression - Choix fichier

    +
    + #if $getVar('openError',False) +
    $openError
    + #end if +
    +

    Mes fichiers

    +
    +
    - - #end if - - +
    + +
    +

    Envoyer un fichier

    +
    + + +
    +
    +
    +
    +
    + + #end if
    #if $getVar('fileName',False)