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 ):
|
||||
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
|
||||
|
||||
|
|
|
@ -68,51 +68,45 @@
|
|||
<li><span style="font-weight:bold;">pages: </span><span id="fileNbPages"></span></li>
|
||||
<hr />
|
||||
#end if
|
||||
|
||||
<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="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>
|
||||
|
||||
#if not $getVar('Erreur_imprimante',False)
|
||||
#if not $getVar('fileName',False)
|
||||
<div id="popupFichiers">
|
||||
<h1>Impression - Choix fichier</h1>
|
||||
<div id="insideDiv">
|
||||
#if $getVar('openError',False)
|
||||
<div style="text-align:center;width:40%;border:2px solid red;margin:5px auto;padding:5px 10px;">$openError</div>
|
||||
#end if
|
||||
|
||||
<form method="post" action="./" enctype="multipart/form-data">
|
||||
<h2>Mes fichiers</h2>
|
||||
<div>
|
||||
<select name="fileList" id="fileList" size="5">
|
||||
#for $file in $fileList
|
||||
<option>$file</option>
|
||||
#end for
|
||||
</select>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button name="submit" class="button" value="submit_chose">Choisir</button>
|
||||
</div>
|
||||
|
||||
<h2>Envoyer un fichier</h2>
|
||||
<div>
|
||||
<input type="file" name="newFile" class="file" />
|
||||
<button name="submit" value="submit_send" class="button">Envoyer</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
#if not $getVar('fileName',False)
|
||||
<div id="popupFichiers">
|
||||
<h1>Impression - Choix fichier</h1>
|
||||
<div id="insideDiv">
|
||||
#if $getVar('openError',False)
|
||||
<div style="text-align:center;width:40%;border:2px solid red;margin:5px auto;padding:5px 10px;">$openError</div>
|
||||
#end if
|
||||
<form method="post" action="./" enctype="multipart/form-data">
|
||||
<h2>Mes fichiers</h2>
|
||||
<div>
|
||||
<select name="fileList" id="fileList" size="5">
|
||||
#for $file in $fileList
|
||||
<option>$file</option>
|
||||
#end for
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
roundElement("popupFichiers");
|
||||
roundElement("insideDiv");
|
||||
</script>
|
||||
#end if
|
||||
|
||||
|
||||
<div class="buttons">
|
||||
<input type="submit" name="submit" class="button" value="Choisir" />
|
||||
</div>
|
||||
<h2>Envoyer un fichier</h2>
|
||||
<div>
|
||||
<input type="file" name="newFile" class="file" />
|
||||
<input type="submit" name="submit" value="Envoyer" class="button">
|
||||
</div>
|
||||
</form>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
roundElement("popupFichiers");
|
||||
roundElement("insideDiv");
|
||||
</script>
|
||||
#end if
|
||||
</div>
|
||||
|
||||
#if $getVar('fileName',False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue