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)