Modification pour ie.
a marche presque... mais ie fait encore des trucs nuls... darcs-hash:20061116222359-f46e9-a7348bde89828fabf9bc2c40a5aafc0c52fed8c4.gz
This commit is contained in:
parent
2ce1e81bcf
commit
dce073de67
2 changed files with 38 additions and 41 deletions
|
@ -20,13 +20,13 @@ class root:
|
||||||
def index(self, submit = None, fileList = None, newFile = None ):
|
def index(self, submit = None, fileList = None, newFile = None ):
|
||||||
data = {}
|
data = {}
|
||||||
cherrypy.session['impression'] = None
|
cherrypy.session['impression'] = None
|
||||||
if submit == "submit_send":
|
if submit == "Envoyer":
|
||||||
try:
|
try:
|
||||||
self.savePDF(newFile)
|
self.savePDF(newFile)
|
||||||
data['fileName'] = newFile.filename
|
data['fileName'] = newFile.filename
|
||||||
except FileError, e:
|
except FileError, e:
|
||||||
data['openError'] = e.args[0]
|
data['openError'] = e.args[0]
|
||||||
elif submit == "submit_chose":
|
elif submit == "Choisir":
|
||||||
if (fileList):
|
if (fileList):
|
||||||
data['fileName'] = fileList
|
data['fileName'] = fileList
|
||||||
else:
|
else:
|
||||||
|
@ -92,8 +92,11 @@ class root:
|
||||||
filepath = os.path.join(os.path.join(FILE_UPLOAD_BASE_FOLDER, cherrypy.session['uid']+"/"), fileName)
|
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'])
|
cherrypy.session['impression'] = crans.impression.impression(filepath, cherrypy.session['uid'])
|
||||||
return {'nbPages': cherrypy.session['impression'].pages()}
|
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:
|
except Exception, e:
|
||||||
cherrypy.log("useFile (erreur): %s" % str(e), 'IMPRESSION', 1)
|
cherrypy.log("useFile : %s" % str(e), 'IMPRESSION', 1)
|
||||||
return {'erreur':str(e) }
|
return {'erreur':str(e) }
|
||||||
useFile.exposed= True
|
useFile.exposed= True
|
||||||
|
|
||||||
|
|
|
@ -68,11 +68,9 @@
|
||||||
<li><span style="font-weight:bold;">pages: </span><span id="fileNbPages"></span></li>
|
<li><span style="font-weight:bold;">pages: </span><span id="fileNbPages"></span></li>
|
||||||
<hr />
|
<hr />
|
||||||
#end if
|
#end if
|
||||||
|
|
||||||
<li id="actionNouvelleImpression"><a href="index">Nouvelle impression</a></li>
|
<li id="actionNouvelleImpression"><a href="index">Nouvelle impression</a></li>
|
||||||
<li id="actionMesCodes"><a href="#" onclick="Impression.mesCodes.getCodes(); return false;">Mes codes</a></li>
|
<li id="actionMesCodes"><a href="#" onclick="Impression.mesCodes.getCodes(); return false;">Mes codes</a></li>
|
||||||
<li id="actionEtatImprimante" onclick="Impression.AJAX.getPrinterState();"><span style="font-weight:bold;">État imprimante:</span><br /><span id="etatImprimanteIci"> $etatImprimante </span></li>
|
<li id="actionEtatImprimante" onclick="Impression.AJAX.getPrinterState();"><span style="font-weight:bold;">État imprimante:</span><br /><span id="etatImprimanteIci"> $etatImprimante </span></li>
|
||||||
<!-- <li><a href="historique">Historique</a></li> -->
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
#if not $getVar('Erreur_imprimante',False)
|
#if not $getVar('Erreur_imprimante',False)
|
||||||
|
@ -83,7 +81,6 @@
|
||||||
#if $getVar('openError',False)
|
#if $getVar('openError',False)
|
||||||
<div style="text-align:center;width:40%;border:2px solid red;margin:5px auto;padding:5px 10px;">$openError</div>
|
<div style="text-align:center;width:40%;border:2px solid red;margin:5px auto;padding:5px 10px;">$openError</div>
|
||||||
#end if
|
#end if
|
||||||
|
|
||||||
<form method="post" action="./" enctype="multipart/form-data">
|
<form method="post" action="./" enctype="multipart/form-data">
|
||||||
<h2>Mes fichiers</h2>
|
<h2>Mes fichiers</h2>
|
||||||
<div>
|
<div>
|
||||||
|
@ -94,13 +91,12 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button name="submit" class="button" value="submit_chose">Choisir</button>
|
<input type="submit" name="submit" class="button" value="Choisir" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Envoyer un fichier</h2>
|
<h2>Envoyer un fichier</h2>
|
||||||
<div>
|
<div>
|
||||||
<input type="file" name="newFile" class="file" />
|
<input type="file" name="newFile" class="file" />
|
||||||
<button name="submit" value="submit_send" class="button">Envoyer</button>
|
<input type="submit" name="submit" value="Envoyer" class="button">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
@ -111,8 +107,6 @@
|
||||||
roundElement("insideDiv");
|
roundElement("insideDiv");
|
||||||
</script>
|
</script>
|
||||||
#end if
|
#end if
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
#if $getVar('fileName',False)
|
#if $getVar('fileName',False)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue