Commit massif sur l'intranet
darcs-hash:20070602131029-c992d-820d228ff611f44b2a1fcb185633a65d865baad2.gz
This commit is contained in:
parent
1917896510
commit
5d71550f6b
6 changed files with 44 additions and 15 deletions
|
@ -143,9 +143,9 @@ class Intranet:
|
|||
|
||||
def send_error_repport(self, **kw):
|
||||
|
||||
# on récupère tout de suite le traceback
|
||||
# on recupere tout de suite le traceback
|
||||
tb = crans.utils.exceptions.formatExc()
|
||||
# entêtes du mail
|
||||
# entetes du mail
|
||||
exp = "intranet"
|
||||
dest = cherrypy.config.get("mail.bugreport", "nounous@crans.org")
|
||||
subject = "Rapport de Bug"
|
||||
|
@ -181,7 +181,7 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
text += "\n= Traceback =\n"
|
||||
text += tb
|
||||
|
||||
#on signe, quand même !
|
||||
#on signe, quand meme !
|
||||
text += "\n-- \nRoot.py pour l'intranet\n"
|
||||
|
||||
quickSend(exp, dest, subject, text)
|
||||
|
@ -199,7 +199,10 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
test.exposed = True
|
||||
|
||||
def _cp_on_http_error(self, status, message):
|
||||
if (cherrypy.config.configMap["global"]["server.environment"] == "development") or 1:
|
||||
if cherrypy.config.configMap["global"]["server.environment"] == "development":
|
||||
cherrypy._cputil._cp_on_http_error(status, message)
|
||||
return
|
||||
if cherrypy.config.configMap["global"]["displayBacktrace"] == "True":
|
||||
cherrypy._cputil._cp_on_http_error(status, message)
|
||||
return
|
||||
if status==403:
|
||||
|
@ -216,7 +219,7 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
}
|
||||
elif status==500:
|
||||
self.send_error_repport(status = status, message = message )
|
||||
# les filtres ne sont pas appliqués, on le fait àla main...
|
||||
# les filtres ne sont pas appliques a la main...
|
||||
from TemplatesManager import TemplatesFilter
|
||||
TemplatesFilter().goWithThisDict({'template':'error', 'values':{'status':status, 'message':message }})
|
||||
else:
|
||||
|
|
|
@ -100,7 +100,8 @@ class TemplatesFilter(BaseFilter):
|
|||
body = self._useMainTemplate(body)
|
||||
else:
|
||||
body = body["page"]
|
||||
cherrypy.response.body = body.encode("utf8")
|
||||
body.encode("utf8")
|
||||
cherrypy.response.body = body
|
||||
|
||||
|
||||
def beforeFinalize(self):
|
||||
|
|
|
@ -28,4 +28,4 @@ crans.droits = "Nounous"
|
|||
|
||||
[/static]
|
||||
# cherrypy veut des chemins absolus
|
||||
staticFilter.dir = "/home/gdetrez/crans.usr.scripts/intranet/static/"
|
||||
staticFilter.dir = "/usr/scripts/intranet/static/"
|
||||
|
|
|
@ -19,12 +19,15 @@ from ClassesIntranet.ModuleBase import ModuleBase
|
|||
class main(ModuleBase):
|
||||
def title(self):
|
||||
return "Factures"
|
||||
def category(self):
|
||||
return "Services"
|
||||
def icon(self):
|
||||
return "icon.png"
|
||||
|
||||
|
||||
_club = True
|
||||
|
||||
def index(self, message = '', error = ''):
|
||||
adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0]
|
||||
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
|
||||
t = {}
|
||||
t['message'] = message
|
||||
t['error'] = error
|
||||
|
@ -62,7 +65,7 @@ class main(ModuleBase):
|
|||
index.exposed = True
|
||||
|
||||
def historique(self, page = 1, items_per_page = 20):
|
||||
adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0]
|
||||
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
|
||||
|
||||
lst = [ x for x in adh.historique() if x.split(u' : ',1)[1].startswith(u'credit') or x.split(u' : ',1)[1].startswith(u'debit') ]
|
||||
histLst = []
|
||||
|
|
|
@ -29,12 +29,30 @@ import crans.impression
|
|||
import crans.impression.digicode
|
||||
import crans.impression.etat_imprimante
|
||||
import crans.cp
|
||||
from threading import Thread
|
||||
FILE_UPLOAD_BASE_FOLDER = cherrypy.config.get('fileUpload.folder', "/var/impression/fichiers/")
|
||||
|
||||
class FileError(Exception):
|
||||
pass
|
||||
from ClassesIntranet.ModuleBase import ModuleBase
|
||||
|
||||
|
||||
# #############################################################
|
||||
# Classe d'impression en multithread
|
||||
# #############################################################
|
||||
class threadedImpression(Thread, crans.impression.impression):
|
||||
def __init__(self, path_to_pdf, adh = None, callback = None):
|
||||
self.tpath_to_pdf = path_to_pdf
|
||||
self.tadh = adh
|
||||
Thread.__init__(self)
|
||||
|
||||
def run():
|
||||
crans.impression.impression.__init__(self, self.tpath_to_pdf, self.tadh)
|
||||
if self.tcallback:
|
||||
self.tcallback(self)
|
||||
|
||||
|
||||
|
||||
class main(ModuleBase):
|
||||
def category(self):
|
||||
return "Services"
|
||||
|
@ -136,7 +154,9 @@ class main(ModuleBase):
|
|||
crans.cp.log("useFile : %s" % str(e), 'IMPRESSION', 1)
|
||||
return {'erreur':str(e) }
|
||||
useFile.exposed= True
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# methode pour changer les parametres
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#if $message != ''
|
||||
#encoding UTF-8
|
||||
#if $getVar('message',False)
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
Crans.messages.setMessage('$message.replace("\'","\\\'")')
|
||||
|
@ -6,7 +7,7 @@ Crans.messages.setMessage('$message.replace("\'","\\\'")')
|
|||
</script>
|
||||
#end if
|
||||
|
||||
#if $error != ''
|
||||
#if $getVar('error',False)
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
Crans.messages.setMessage('$error.replace("\'","\\\'")', 'errorMessage')
|
||||
|
@ -51,7 +52,7 @@ Crans.messages.setMessage('$error.replace("\'","\\\'")', 'errorMessage')
|
|||
<dt>Solde :</dt>
|
||||
<dd>
|
||||
$adherent.solde €
|
||||
<span class="actions"><a href="rechargerCompteImpression" onclick="return paypalWindow('$adherent.telephone')">modifier</a></span>
|
||||
|
||||
<div class="clear"></div>
|
||||
</dd>
|
||||
<dt>Téléphone :</dt>
|
||||
|
@ -94,7 +95,8 @@ Crans.messages.setMessage('$error.replace("\'","\\\'")', 'errorMessage')
|
|||
<input type="password" id="ancienPassword" name="ancienPassword"/><br />
|
||||
<label class="textInputLabel" for="nouveauPassword1">Nouveau mot de passe : </label>
|
||||
<input type="password" id="nouveauPassword1" name="nouveauPassword1"/><br />
|
||||
<a class="textInputNote" href="#" onclick="return GeneratePassword()">Générer un nouveau mot de passe</a><br />
|
||||
<a class="textInputNote" href="#" onclick="return
|
||||
GeneratePassword()">Générer un nouveau mot de passe</a><br />
|
||||
<label class="textInputLabel" for="nouveauPassword2">Confirmation : </label>
|
||||
<input type="password" id="nouveauPassword2" name="nouveauPassword2"/><br />
|
||||
<input type="submit" value="Modifier" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue