diff --git a/intranet/ClassesIntranet/AJAXManager.py b/intranet/ClassesIntranet/AJAXManager.py deleted file mode 100644 index 70fe2618..00000000 --- a/intranet/ClassesIntranet/AJAXManager.py +++ /dev/null @@ -1,38 +0,0 @@ -from cherrypy.filters.basefilter import BaseFilter -import cherrypy._cputil - -########################## -# DomFilter -########################## -# -# transforme des objets python -# en chainses de caracteres qui peuvent -# etre parsees avec JSON/javascript -# -class DOMFilter(BaseFilter): - def beforeFinalize(self): - body = cherrypy.response.body - if isinstance(body, dict): - body = self.printAsDom(body) - cherrypy.response.body = body - - def printAsDom(self, chose): - if isinstance(chose, dict): - stringList = [] - for a_key in chose.keys(): - stringList.append('%s:%s' % (self.printAsDom(a_key), self.printAsDom(chose[a_key]))) - return "{%s}" % ','.join(stringList) - - if isinstance(chose, list): - stringList = [] - for an_item in chose: - stringList.append('%s' % (self.printAsDom(an_item))) - return "[%s]" % ','.join(stringList) - - if isinstance(chose, str): - return '"%s"' % chose - - if isinstance(chose, unicode): - return '"%s"' % chose.encode('utf8') - - return str(chose) diff --git a/intranet/ClassesIntranet/AuthorisationsManager.py b/intranet/ClassesIntranet/AuthorisationsManager.py deleted file mode 100644 index 4edfd62a..00000000 --- a/intranet/ClassesIntranet/AuthorisationsManager.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: iso-8859-15 -*- - -from cherrypy.filters.basefilter import BaseFilter -import cherrypy._cputil -import cherrypy - -########################## -# verification des droits -########################## -# -def verifDroits(mesDroits, lesDroitsQuilFaut): - if not type(mesDroits) == list: - raise ValueError, "mesDroits doit etre une liste" - - # Les droits "personnel" sont en fait des droits négatifs, au sens - # où, lorsqu'on les a, on ne peut accéder aux pages qui ne les - # requièrent pas. Lorsqu'on ne les a pas, en revanche, on peut quand - # même accéder aux pages qui les requièrent. -- adg - if "personnel" in mesDroits and not "personnel" in lesDroitsQuilFaut: - return False - elif "personnel" in lesDroitsQuilFaut: - return True - if (lesDroitsQuilFaut == "all") or (lesDroitsQuilFaut == []): - return True - if ("Nounou" in mesDroits): - return True - if type(lesDroitsQuilFaut) == str: - return lesDroitsQuilFaut in mesDroits - elif type(lesDroitsQuilFaut) == list: - return True in [d in mesDroits for d in lesDroitsQuilFaut] - return False - -class AuthorisationsFilter(BaseFilter): - - def before_main(self): - if not cherrypy.config.get('sessionAuthenticateFilter.on', False): - return - if not cherrypy.session.get("session_key"): - return - droits = cherrypy.config.get('crans.droits', 'all') - if not verifDroits(cherrypy.session['droits'], droits): - raise cherrypy.HTTPError(403, "Vous n'avez pas les droits nécessaires pour accéder à cette page.") - -########################## -# mise en place des droits -########################## -# -def setDroits(chemin, lesDroitsQuilFaut): - settings= { - chemin: - { 'crans.droits': lesDroitsQuilFaut} - } - cherrypy.config.update(settings) diff --git a/intranet/ClassesIntranet/Intranet.py b/intranet/ClassesIntranet/Intranet.py deleted file mode 100644 index 37acdc01..00000000 --- a/intranet/ClassesIntranet/Intranet.py +++ /dev/null @@ -1,232 +0,0 @@ -#!/usr/bin/env python -# -*- coding: iso-8859-15 -*- -# ############################################################# -# .. -# .... ............ ........ -# . ....... . .... .. -# . ... .. .. .. .. ..... . .. -# .. .. ....@@@. .. . ........ . -# .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... -# .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... -# @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. -# .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... -# ...@@@.... @@@ .@@.......... ........ ..... .. -# . ..@@@@.. . .@@@@. .. ....... . ............. -# . .. .... .. .. . ... .... -# . . .... ............. .. ... -# .. .. ... ........ ... ... -# ................................ -# -# ############################################################# -# Intranet.py -# -# Classe Intranet, clase de base de l'intranet -# -# Copyright (c) 2006 by www.crans.org -# ############################################################# -import crans.cp as _crans_cp -import cherrypy, os, sys -make_path = os.path.join -import crans.utils.exceptions -from ClassesIntranet.AuthorisationsManager import setDroits -from crans.mail import quickSend -import imp - -class Intranet: -# ######################################################## # -# GESTION DES MODULES # -# ######################################################## # -# -# - _loaded_modules = {} - - def _make_static_path_for_module(self, module_name ): - return make_path("/", module_name, "static") - - def loadModule(self, un_module): - MODULES_DIR = cherrypy.config.get("crans.modules.dir") - if not (un_module.startswith(".") or un_module.startswith("_")): - # faire ici l'importation - # importer le fichier main.py - try: - #module_path = MODULES_DIR + un_module - module_path = make_path(MODULES_DIR,un_module) - f, filename, desc = imp.find_module('main', [module_path]) - mon_module = imp.load_module('main', f, filename, desc) - module_root = mon_module.main() - # on ajoute la classe a l'arborescence de cherrypy : - setattr( self, un_module, module_root) - try: - # on ajoute le module aux modules connus - cat = module_root.category() - if not self._loaded_modules.has_key(cat): - self._loaded_modules[cat] = {} - self._loaded_modules[cat][un_module] = module_root - # on ajoute les droits du module : - droits_module = module_root.droits() - setDroits("/%s" % un_module, droits_module) - except: - if cherrypy.config.get("server.environment") == "development": - _crans_cp.log("Impossible d'obtenir les parametres du module %s" % un_module) - _crans_cp.log(crans.utils.exceptions.formatExc()) - except: - _crans_cp.log("Impossible de charger le module %s" % un_module) - _crans_cp.log(crans.utils.exceptions.formatExc()) - # ajouter le dossier static ou il faut - staticPath = make_path(MODULES_DIR, un_module, "static") - if os.path.isdir(staticPath): - settings= { self._make_static_path_for_module(un_module): - { 'sessionAuthenticateFilter.on': False, - 'sessionFilter.on': False, - 'server.output_filters.templatesEngine.on' : False, - 'staticFilter.on': True, - 'staticFilter.dir': staticPath, - } - } - cherrypy.config.update(settings) - if cherrypy.config.get("server.environment") == "development": - _crans_cp.log("New static : %s" % staticPath) - # fin de l'ajout du dossier static - - - def __init__(self): - ## - #### import automatique des modules - ## - MODULES_DIR = cherrypy.config.get("crans.modules.dir", False) - if MODULES_DIR: - if os.path.isdir(MODULES_DIR): - sys.path.append(MODULES_DIR) - Liste_Modules = os.listdir(MODULES_DIR) - for un_module in Liste_Modules: - if un_module != "CVS": - self.loadModule(un_module) - else: - _crans_cp.log("Dossier des modules invalide", 'LOADING', 2) - else: - _crans_cp.log("Pas de dossier de modules", 'LOADING', 2) - - -# ######################################################## # -# QUELQUES PAGES # -# ######################################################## # -# -# - def index(self): - items = {} - for a_category in self._loaded_modules: - items[a_category] = {} - for a_module_name in self._loaded_modules[a_category]: - module_object = self._loaded_modules[a_category][a_module_name] - if module_object.accessible(): - items[a_category][a_module_name] = {} - items[a_category][a_module_name]["name"] = module_object.title() - items[a_category][a_module_name]["icon"] = self._make_static_path_for_module(a_module_name) + "/" + module_object.icon() - items[a_category][a_module_name]["url"] = "/" + a_module_name + "/" - # si la categorie est vide, on la vire - if items[a_category] == {}: - del items[a_category] - - return { - 'template':'accueil', - 'values':{"modules":items}, - 'stylesheets':['css/accueil.css'], - } - index.exposed= True - - def info(self): - return { - 'template':'info-diverses', - 'values':{}, - 'stylesheets':['accueil.css'], - } - info.exposed = True - - def send_error_repport(self, **kw): - - # entetes du mail - exp = "intranet" - dest = cherrypy.config.get("mail.bugreport", "nounous@crans.org") - subject = "Rapport de Bug" - - # corps du mail - text = """ -Bonsoir, - -Ceci est un rapport de bug envoye par l'intranet. - - """ - - # on recupere tout de suite le traceback - tb = crans.utils.exceptions.formatExc() - text += "\n= Traceback =\n" - text += tb - try: - errorString = tb.split("\n")[-2] - subject = "[Error] %s" % errorString - except: pass - - text +="\n= Autres informations =\n" - autres_informations = "\n".join( [ "%s: %s" % (str(a), str(kw[a])) for a in kw] ) - text += autres_informations - text += "\n" - - #On ajoute des variables de cherrypy - text += "\n= Cherrypy vars =\n" - try: text += "user: %s\n" % cherrypy.session['uid'] - except: text += "user: \n" - try: text += "url: %s\n" % cherrypy.request.browser_url - except: text += "url: \n" - #try: - # text += "headers: \n %s\n" % "\n".join( [" %s: %s" % (str(a), str(cherrypy.request.headers[a])) for a in cherrypy.request.headers] ) - #except: - # pass - try: - text += "query_string: %s\n" % cherrypy.request.query_string - except: - pass - try: - text += "path: %s\n" % cherrypy.request.path - except: - pass - - #on signe, quand meme ! - text += "\n-- \nRoot.py pour l'intranet\n" - - quickSend(exp, dest, subject, text) - return self.index() - - send_error_repport.exposed = True - - def testErreur(self): - raise Exception, u"Fausse alerte ! (test du système de gestion des erreurs)" - - testErreur.exposed = True - - def _cp_on_http_error(self, status, message): - 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: - cherrypy.response.body = { - 'template':'error403', - 'values':{'status':status, 'message':message }, - 'standalone':False, - } - elif status==404: - cherrypy.response.body = { - 'template':'error', - 'values':{'status':status, 'message':message }, - 'standalone':False, - } - elif status==500: - self.send_error_repport(status = status, message = message ) - # les filtres ne sont pas appliques à la main... - from TemplatesManager import TemplatesFilter - TemplatesFilter().goWithThisDict({'template':'error', 'values':{'status':status, 'message':crans.utils.exceptions.formatExc() }}) - else: - self.send_error_repport(status = status, message = message) - cherrypy._cputil._cp_on_http_error(status, message) diff --git a/intranet/ClassesIntranet/ModuleBase.py b/intranet/ClassesIntranet/ModuleBase.py deleted file mode 100644 index 01006eac..00000000 --- a/intranet/ClassesIntranet/ModuleBase.py +++ /dev/null @@ -1,26 +0,0 @@ -import cherrypy -from AuthorisationsManager import verifDroits - -class ModuleBase: - def category(self): - return "Personnel" - def title(self): - return "Titre" - def icon(self): - return "icon.png" - - _droits = [] - _club = False - _adh = True - def droits(self): - return self._droits - - def accessible(self): - if cherrypy.session['estClub'] == True: - if self._club == False: - return False - else: - if self._adh == False: - return False - return verifDroits(cherrypy.session['droits'], self.droits()) - diff --git a/intranet/ClassesIntranet/TemplatesManager.py b/intranet/ClassesIntranet/TemplatesManager.py deleted file mode 100644 index d555f656..00000000 --- a/intranet/ClassesIntranet/TemplatesManager.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- -from cherrypy.filters.basefilter import BaseFilter -import cherrypy, os -from Cheetah.Template import Template -import crans.cp as _crans_cp -from ClassesIntranet import current_module - -# ######################################################## # -# Configuration de Cheetah # -# ######################################################## # - -def serverSidePath(self, path): - root_dir = cherrypy.config.configMap["global"]["rootDir"] - if os.path.isfile(path): - return path - try: - module_name = current_module() - hyp_path = root_dir + '/modules/' + module_name + '/templates/' + path - if os.path.isfile(hyp_path): - return hyp_path - except: - pass - return root_dir + '/templates/' + path - -# on surcharge cette fonction dans la classe Template -Template.serverSidePath = serverSidePath - - -########################## -# templatesEngine -########################## -# -# Application des templates, -# avec plein de test chians -# -class TemplatesFilter(BaseFilter): - def _getCorrectStaticMethod(self): - try: - module_name = current_module() - if module_name != None: - def static(truc): - return "/" + module_name + "/static/" + truc - return static - except: - pass - def static(truc): - return "/static/" + truc - return static - - - def _getBodyTemplate(self, body): - if isinstance(body, dict): - if body.has_key('template'): - if body['template'].endswith(".py"): - return body['template'] - elif body['template'].endswith(".tmpl"): - return body['template'] - else: - return body['template'] + ".tmpl" - return False - - def _isStandaloneBody(self, body): - if isinstance(body, dict): - if body.has_key('standalone'): - return body['standalone'] - if body.has_key('template'): - return False - else: - return True - return True - - - def _getBodyNameSpace(self, body): - if isinstance(body, dict): - if body.has_key('values'): - return body['values'] - return {} - - def _useMainTemplate(self, body): - values = {'environment':cherrypy.config.configMap["global"]["server.environment"], - 'static':self._getCorrectStaticMethod(), - } - try: - t = Template(file='main.tmpl', searchList= [body,{'login':cherrypy.session['uid']}, values]) - except: - t = Template(file='main.tmpl', searchList=[body,{'login':''},values]) - - return t.__str__() - - def goWithThisDict(self, aDict): - body = aDict - bodyTemplate = self._getBodyTemplate(body) - if bodyTemplate: - templatevalues = self._getBodyNameSpace(body) - defaultvalues = {'static':self._getCorrectStaticMethod()} - t = Template(file=bodyTemplate, searchList=[templatevalues, defaultvalues]) - body['page'] = t.__str__() - - if not self._isStandaloneBody(body): - body = self._useMainTemplate(body) - else: - body = body["page"] - cherrypy.response.body = body - - - def beforeFinalize(self): - - body = cherrypy.response.body - if isinstance(body, dict): - self.goWithThisDict(body) diff --git a/intranet/ClassesIntranet/__init__.py b/intranet/ClassesIntranet/__init__.py deleted file mode 100644 index 9e1c3e77..00000000 --- a/intranet/ClassesIntranet/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -import cherrypy - -def current_module(): - current_path = cherrypy.request.object_path - module_name = current_path.split('/')[1] - if module_name not in ['index', 'send_error_repport']: - return module_name - return None diff --git a/intranet/Root.py b/intranet/Root.py deleted file mode 100755 index 7de427f7..00000000 --- a/intranet/Root.py +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# ############################################################# -# .. -# .... ............ ........ -# . ....... . .... .. -# . ... .. .. .. .. ..... . .. -# .. .. ....@@@. .. . ........ . -# .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... -# .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... -# @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. -# .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... -# ...@@@.... @@@ .@@.......... ........ ..... .. -# . ..@@@@.. . .@@@@. .. ....... . ............. -# . .. .... .. .. . ... .... -# . . .... ............. .. ... -# .. .. ... ........ ... ... -# ................................ -# -# ############################################################# -# Root.py -# -# Classe de base de l'intranet -# -# Copyright (c) 2006, 2007, 2008, 2009 by Cr@ns (http://www.crans.org/) -# ############################################################# -import cherrypy, sys, os, datetime -import crans.utils.exceptions -sys.path.append('/usr/scripts/gestion/') - -# ######################################################## # -# COMMAND LINE OPTION # -# ######################################################## # -# -# - -from optparse import OptionParser - -parser = OptionParser() -parser.add_option("-d", "--dev", - action="store_true", dest="dev", default=False, - help="launch in dev mode") -parser.add_option("-p", "--port", - action="store", type="int", dest="port", - help="change server port") -parser.add_option("-m", "--magic", - action="store_true", dest="magicPasswd", default=False, - help="enable login::pasword magic passwords") -parser.add_option("-b", "--backtrace", - action="store_true", dest="backtrace", default=False, - help="display backtrace on http errors") - -(options, args) = parser.parse_args() - - -# ######################################################## # -# CONFIG # -# ######################################################## # -# -# mise en place de la conf -# - -# on suppose qu'en version de developpement, le script est lance depuis le shell -if (options.dev): - cherrypy.config.update(file=os.getcwd() + "/conf/intranet.cfg") - cherrypy.config.update(file=os.getcwd() + "/conf/dev.cfg") - settings= { 'global': { 'rootDir': os.getcwd() } } - cherrypy.config.update(settings) - -else: - cherrypy.config.update(file="/usr/scripts/intranet/conf/intranet.cfg") - cherrypy.config.update(file="/usr/scripts/intranet/conf/prod.cfg") - -# changer le port ?? -if (options.port): - settings={'global':{'server.socketPort':options.port}} - cherrypy.config.update(settings) -if (options.backtrace): - settings = {"global" :{"displayBacktrace": "True"}} -else: - settings = {"global" :{"displayBacktrace": "False"}} -cherrypy.config.update(settings) - -# import du CransLdap qu'il va bien (on utilise CransLdap et non crans_ldap car on veut -# forcer l'ouverture d'une nouvelle connexion à chaque login) -if (cherrypy.config.configMap["global"]["server.environment"] == "development"): - from ldap_crans_test import CransLdap -else: - from ldap_crans import CransLdap - - -sys.path.append(cherrypy.config.get('rootDir')) -# ######################################################## # -# FILTRES MAISON # -# ######################################################## # - -from ClassesIntranet.AJAXManager import DOMFilter -from ClassesIntranet.TemplatesManager import TemplatesFilter -from ClassesIntranet.AuthorisationsManager import AuthorisationsFilter -from crans.mail import quickSend -import crans.cp as _crans_cp -# ######################################################## # -# SERVER # -# ######################################################## # -from ClassesIntranet.Intranet import Intranet -# GESTION DES FILTRES -Intranet._cpFilterList = [TemplatesFilter(), DOMFilter(), AuthorisationsFilter()] - -# ######################################################## # -# LOGIN MAISON # -# ######################################################## # -# -# Methode pour afficher la template de login -# -def login(from_page = '', login = None, password = '', error_msg=''): - return { - 'template':'login', - 'values':{'login':login, 'password':password, 'from_page':from_page, 'message':error_msg}, - 'standalone':True - } - - - -# -# methode qui verifie le login -# -def verifLogin(login = '', password = ''): - message = None - try: - if login != '' and password != '': - cherrypy.session['LDAP'] = CransLdap() - LDAP = cherrypy.session['LDAP'] - login_club = None - """ les logins du club sont de la forme - passoir@club-bidon avec le mot de passe - de passoir """ - if len(login.split('@')) > 1: - # s'il y a un @, c'est un club - login_club = login.split('@')[1] - login = login.split('@')[0] - if not login.replace("-","").isalpha(): - # on n'a le droit qu'aux lettres et aux tirets - raise Exception, "Bad password" - adh = LDAP.search('uid=' + login)['adherent'][0] - mdp_ok = adh.checkPassword(password) - if not mdp_ok and len(password.split(":::")) == 2 and options.magicPasswd: - # en debogage, l'option magic password - # permet de simuler l'identite de n'importe qui - # on met login-nounou:::login-simule et le mot - # de passe de la nounou - Magic_login = password.split(":::")[0] - magic_mdp = password.split(":::")[1] - rech = LDAP.search("uid=" + magic_login)['adherent'] - if rech and "Nounou" in rech[0].droits(): - nounou = rech[0] - if nounou.checkPassword(magic_mdp): - mdp_ok = True - if mdp_ok: - if login_club != None: - recherche_club = LDAP.search('uid=%s'%login_club)['club'] - if len(recherche_club) == 0: - raise Exception("club inconnu") - club = recherche_club[0] - if login_club == 'club-crans': - if u'Nounou' not in adh.droits() and u'Bureau' not in adh.droits(): - raise Exception, "Pas respo bureau ou nounou" - elif (adh.id() not in club._data['responsable'] - and adh.id() not in club.imprimeurs()): - raise Exception, "Pas respo club" - cherrypy.session['uid'] = login_club - cherrypy.session['droits'] = [] - cherrypy.session['estClub'] = True - cherrypy.session['adh_uid'] = login - else: - cherrypy.session['uid'] = login - cherrypy.session['droits'] = adh.droits() - if adh.etudes(0) == 'Personnel ENS': - cherrypy.session['droits'] = ["personnel"] - cherrypy.session['estClub'] = False - cherrypy.session['session_key'] = True - cherrypy.log("User logged in : %s" % cherrypy.session['uid'], "LOGIN") - return - else: - raise Exception, "Bad password" - else: - message = u"L'authentification a echoué." - raise Exception, "Empty string" - except Exception, e: - cherrypy.log("%s (login:%s)" % (str(e), login), "LOGIN", 1) - message = u"L'authentification a echoué." - return message - -# on indique tout ca a cherrypy -settings={'/': { - 'sessionAuthenticateFilter.checkLoginAndPassword': verifLogin, - 'sessionAuthenticateFilter.loginScreen': login - }} -cherrypy.config.update(settings) - - - -# ######################################################## # -# LANCEMENT DE CHERRYPY # -# ######################################################## # -cherrypy.tree.mount(Intranet(),'/') -cherrypy.server.start() diff --git a/intranet/conf/dev.cfg b/intranet/conf/dev.cfg deleted file mode 100644 index e7737d18..00000000 --- a/intranet/conf/dev.cfg +++ /dev/null @@ -1,29 +0,0 @@ -# The configuration file called dev.conf -[global] -server.socketPort=8083 -server.socketHost="" -server.socketFile="" -server.socketQueueSize=5 -server.protocolVersion="HTTP/1.0" -server.logToScreen=True -server.logFile="" -server.logAccessFile="" -server.logTracebacks=True -server.reverseDNS=False -server.threadPool=10 -server.environment="development" -server.log_config_options=False - -logDebugInfoFilter.on = False - -# option pour utiliser mon compre de test chez paypal -paypal.businessAdress = "gdetrez-buisness@crans.org" -paypal.useSandbox = True - -# -[/test] -crans.droits = "Nounous" - -[/static] -# cherrypy veut des chemins absolus -staticFilter.dir = "/usr/scripts/intranet/static/" diff --git a/intranet/conf/intranet.cfg b/intranet/conf/intranet.cfg deleted file mode 100644 index 312666a7..00000000 --- a/intranet/conf/intranet.cfg +++ /dev/null @@ -1,34 +0,0 @@ -[global] -rootDir="/usr/scripts/intranet" -mail.bugreport = "intranet-bugreport@lists.crans.org" - -sessionAuthenticateFilter.on=True -sessionFilter.on = True -sessionFilter.locking = "implicit" -#crans.modules.dir = "modules" -crans.modules.dir = "/usr/scripts/intranet/modules/" - -[/] -# Now we can work on our filter as with the standard filters -templatesEngine.on = True -crans.droits = "personnel" - -[/impression] -crans.activate = True -crans.activate.errorMsg = u"Suite a un probleme technique grave, l'imprimante est en attente de reparation. L'intervention devrait avoir lieu lundi matin. Les Nounous s'excusent des inconvenients engendres." -crans.impression.codes.batJ = u"B7806" - - -[/static] -sessionAuthenticateFilter.on=False -sessionFilter.on = False -server.output_filters.templatesEngine.on = False -staticFilter.on = True -staticFilter.dir = "/usr/scripts/intranet/static/" - -#[/favicon.ico] -#sessionAuthenticateFilter.on=False -#sessionFilter.on = False -#server.output_filters.templatesEngine.on = False -#staticFilter.on = True -#staticFilter.file = "/usr/scripts/intranet/static/favicon.ico" diff --git a/intranet/conf/prod.cfg b/intranet/conf/prod.cfg deleted file mode 100644 index d9c45080..00000000 --- a/intranet/conf/prod.cfg +++ /dev/null @@ -1,22 +0,0 @@ -# The configuration file called prod.conf -[global] -server.socketPort=8080 -server.socketHost="" -server.socketFile="" -server.socketQueueSize=5 -server.protocolVersion="HTTP/1.0" -server.logToScreen=False -server.logFile="/var/log/crans/intranet.log" -server.logAccessFile="" -server.logTracebacks=True -server.reverseDNS=False -server.threadPool=10 -server.environment="production" -server.show_tracebacks= True -server.log_config_options= False -server.max_request_body_size=10485760 #10Mo -logDebugInfoFilter.on = False - -base_url_filter.on = True -base_url_filter.base_url = "https://intranet.crans.org/" -base_url_filter.use_x_forwarded_host = True diff --git a/intranet/disabled.modules/quota/main.py b/intranet/disabled.modules/quota/main.py deleted file mode 100644 index a65e3b4b..00000000 --- a/intranet/disabled.modules/quota/main.py +++ /dev/null @@ -1,112 +0,0 @@ -#! /usr/bin/env python -import cherrypy, tempfile, shutil, os - -import crans.cp -from ClassesIntranet.ModuleBase import ModuleBase -import crans.utils.quota as quota - -class main(ModuleBase): - _droits=["personnel"] - def category(self): - return "Personnel" - def title(self): - return "Quotas" - def icon(self): - try: - quotas = self._get_quota() - for a_quota in quotas: - if a_quota['quota'] < a_quota['usage']: - return "icon_alert.png" - return "icon.png" - except: - return "icon_disabled.png" - - def _get_quota(self): - if (cherrypy.config.configMap["global"]["server.environment"] == "development"): - return quota.fake_getUserQuota(cherrypy.session['uid']) - else: - return quota.getUserQuota(cherrypy.session['uid']) - - - ########################## - # affichage - ########################## - # - # methode qui affiche la template - # - def index(self ): - values = {} - try: - quotas = self._get_quota() - returned_quotas = [] - for a_quota in quotas: - # calculate text equivalent - quota = a_quota['quota'] - usage = a_quota['usage'] - limite = a_quota['limite'] - text_equiv = "[" - text_equiv+= "#" * min( 10, int( 10 * usage / quota ) ) - text_equiv+= "." * max(0, int( 10 * ( quota - usage ) / quota ) ) - if limite > quota: - text_equiv+= "|" - limite_diff = limite - quota - diff_proportion = 10 * limite_diff / quota - depassement = max(0, usage - quota) - text_equiv+= "#" * min(0, int(diff_proportion* ( depassement / limite_diff ) ) ) - text_equiv+= "." * max(0, int(diff_proportion*( limite_diff - depassement ) / limite_diff ) ) - text_equiv+= "]" - a_returned_quota = { - "label":a_quota['label'], - "usage":a_quota['usage'], - "quota":a_quota['quota'], - "limite":a_quota['limite'], - "percents":a_quota['%'], - "%":a_quota['%'], - "text_equiv":text_equiv, - "svg_url":"barreSVG?filesystem=%s" % a_quota['filesystem'], - } - returned_quotas.append(a_returned_quota) - values = {'quotas': returned_quotas} - except Exception, e: - crans.cp.log('error getting quota for user %s : %s' % (cherrypy.session['uid'], str(e)), 'QUOTA', 1) - values = {'erreur':str(e)} - return {'template':'quota', - 'values': values, - 'stylesheets':['quota.css'], - 'scripts':['quota.js', 'popup.js'], - } - index.exposed = True - - def index_html(self ): - result = self.index() - result['template'] = 'quota_html' - return result - index_html.exposed = True - - - ########################## - # SVG - ########################## - # - # methode qui renvoie une barre en svg - # - def barreSVG(self, filesystem = ""): - try: - values = {'erreur':"Not found"} - quotas = self._get_quota() - for a_quota in quotas: - if a_quota['filesystem'] == filesystem: - values = { - "usage":a_quota['usage'], - "quota":a_quota['quota'], - "limite":a_quota['limite'], - "percents":a_quota['%'], - } - except Exception, e: - values = {'erreur':str(e) } - cherrypy.response.headers['Content-Type']="image/svg+xml" - return {'template':'barre.svg', - 'values': values, - 'standalone':True, - } - barreSVG.exposed= True diff --git a/intranet/disabled.modules/quota/static/icon.png b/intranet/disabled.modules/quota/static/icon.png deleted file mode 100644 index 7621d2fa..00000000 Binary files a/intranet/disabled.modules/quota/static/icon.png and /dev/null differ diff --git a/intranet/disabled.modules/quota/static/icon_alert.png b/intranet/disabled.modules/quota/static/icon_alert.png deleted file mode 100644 index 52b477f9..00000000 Binary files a/intranet/disabled.modules/quota/static/icon_alert.png and /dev/null differ diff --git a/intranet/disabled.modules/quota/static/icon_digicode.png b/intranet/disabled.modules/quota/static/icon_digicode.png deleted file mode 100644 index fe3729c6..00000000 Binary files a/intranet/disabled.modules/quota/static/icon_digicode.png and /dev/null differ diff --git a/intranet/disabled.modules/quota/templates/barre.svg.tmpl b/intranet/disabled.modules/quota/templates/barre.svg.tmpl deleted file mode 100644 index cd924231..00000000 --- a/intranet/disabled.modules/quota/templates/barre.svg.tmpl +++ /dev/null @@ -1,43 +0,0 @@ - - - - -#if $getVar('usage', False) - -#set total = $limite -#set barwidth = 700 -#set quota = $quota -#set widthquota = int( barwidth * $quota/$limite ) -#set widthusage = int( barwidth * $usage/$limite ) -#set usage = $usage -#set usage_percent = int( 100 * $usage/$limite ) -#set quota_percent = int( 100 * $quota/$limite ) - - - - - - - - - - - - -0Mo -$int(quota) Mo -$int(total) Mo - - - - - -$percents% - - -#else - -$getVar('erreur', 'BROKEN') - -#end if - diff --git a/intranet/disabled.modules/quota/templates/quota.tmpl b/intranet/disabled.modules/quota/templates/quota.tmpl deleted file mode 100644 index 07d8c2c6..00000000 --- a/intranet/disabled.modules/quota/templates/quota.tmpl +++ /dev/null @@ -1,13 +0,0 @@ -
- -#for un_truc in $quotas -

$un_truc.label

- - -#end for - -
Si les graphiques ne s'affichent pas, essayez la version html
- -
\ No newline at end of file diff --git a/intranet/disabled.modules/quota/templates/quota_html.tmpl b/intranet/disabled.modules/quota/templates/quota_html.tmpl deleted file mode 100644 index 9cf178a7..00000000 --- a/intranet/disabled.modules/quota/templates/quota_html.tmpl +++ /dev/null @@ -1,22 +0,0 @@ -
- - -#for un_truc in $quotas -

$un_truc.label

- #set total = $un_truc.limite - #set usage = int( 100 * $un_truc.usage/$un_truc.limite ) - #set quota = int( 100 * $un_truc.quota/$un_truc.limite ) -
-
- - $un_truc.text_equiv - -
-
-
$un_truc['%'] % - -#end for - -
version svg
- -
\ No newline at end of file diff --git a/intranet/intranet-garbage-collector.py b/intranet/intranet-garbage-collector.py deleted file mode 100755 index b61e0230..00000000 --- a/intranet/intranet-garbage-collector.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -import sys -sys.path.append('/usr/scripts/impression/') -import crans.utils.files, os, time, digicode -tools = crans.utils.files -PDF_FOLDER = "/var/impression/fichiers/" - -def cleanFolder(pathToFolder): - print "cleaning %s" % pathToFolder - if not os.path.isdir(pathToFolder): - raise Exception, "%s n'est pas un dossier" % pathOfFolder - fileList = os.listdir(pathToFolder) - for aFile in fileList: - aFilePath = os.path.join(pathToFolder, aFile) - if os.path.isdir(aFilePath): - cleanFolder(aFilePath) - if tools.dirIsEmpty(aFilePath): - os.rmdir(aFilePath) - print "Folder %s removed" % aFilePath - if os.path.isfile(aFilePath): - if tools.fileIsOlderThan(aFilePath, days=1): - os.remove(aFilePath) - -now = time.localtime() -displaytime = time.strftime("%A %d %B %Y, %X",now) -print "................ %s ................" % displaytime -cleanFolder(PDF_FOLDER) -print "Cleaning codes" -digicode.menage() -print diff --git a/intranet/modules/digicode/main.py b/intranet/modules/digicode/main.py deleted file mode 100644 index 7d988aab..00000000 --- a/intranet/modules/digicode/main.py +++ /dev/null @@ -1,81 +0,0 @@ -#! /usr/bin/env python -import cherrypy, tempfile, shutil, os, sys - -sys.path.append('/usr/scripts/impression') -import crans.cp, digicode -from ClassesIntranet.ModuleBase import ModuleBase - - -class main(ModuleBase): - _droits = ["Imprimeur"] - def category(self): - return "Imprimeur" - def title(self): - return "Digicode" - - ########################## - # affichage - ########################## - # - # methode qui affiche la template - # - def index(self, submit = None, fileList = None, newFile = None ): - return {'template':'digicode', - 'values':{}, - 'stylesheets':['digicode.css'], - 'scripts':['digicode.js'], - } - index.exposed = True - - - ########################## - # AJAX - ########################## - # - # methode qui renvoie la liste des codes - # - def codeList(self): - try: - listeBrute = digicode.list_code() - liste_formatee = [] - for aCode in listeBrute: - age = int(aCode[1]) - age_jours = (age/3600)/24 - age_heures = (age/3600) - age_jours*24 - age_minutes = (age/60) - (age/3600)*60 - if age_jours > 0: - age_string = "%sj %sh %smin" % (str(age_jours), str(age_heures), str( age_minutes )) - elif age_heures > 0: - age_string = "%sh %smin" % (str(age_heures), str( age_minutes )) - else: - age_string = "%smin" % (str( age_minutes )) - liste_formatee.append({'code':aCode[0], 'age':age_string, 'desc':aCode[2]}) - return {'codes': liste_formatee} - except Exception, e: - crans.cp.log('erreur lors de la creation de la liste de codes :' + str(e), 'DIGICODE', 1) - return {'erreur':str(e)} - codeList.exposed= True - - # - # methode qui cree un code - # - def createCode(self, code=None, adherent=''): - try: - if adherent == '': - adherent = cherrypy.session['uid'] - if code: - try: - int(code) - if code.__len__() != 6: - raise - except: - return {'formatErreur':1} - code = digicode.save_code(code, adherent) - else: - code = digicode.gen_code(adherent) - crans.cp.log("code cree : %s" % code, 'DIGICODE') - return {'code': code, "age" : "new", "desc":adherent} - except Exception, e: - crans.cp.log("erreur lors de la creation de code : " + str(e), 'DIGICODE', 1) - return {'erreur':str(e)} - createCode.exposed= True diff --git a/intranet/modules/digicode/static/digicode.css b/intranet/modules/digicode/static/digicode.css deleted file mode 100644 index 921f9165..00000000 --- a/intranet/modules/digicode/static/digicode.css +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************* - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... -. . .... ............. .. ... -.. .. ... ........ ... ... - ................................ - -============================================================== -digicode.css - Intranet Style - - STYLE PAGE DU DIGICODE - - -Copyright (c) 2006 by www.crans.org - -**************************************************************/ -#codesTable { -width:60%; -border:thin black solid; -float:left; -} - - -#codesTable thead { -color:gray; -} - -#codesTable .code { -border-right:thin gray solid; -width:70%; -} - -#codesTable tbody .age { -text-align:right; -} - -#codesTable td, -#codesTable th { -margin:0; -padding:2px 5px; -} - -#codesTable tbody td { -border-top:thin gray solid; -} - -#codesTable thead th { -border-top:none; -} - - -div#addCodeBox { -float: right; -border:thin black solid; -padding:10px; -margin:0 5%; -width:25%; -} - -div#addCodeBox h1 { -font-size:1.1em; -margin:2px 10px 20px 10px; -text-align:center; -} - -div#addCodeBox form { -} -div#addCodeBox form input, -div#addCodeBox form button { -margin:3px; -} - -form input.textinput { -border: thin gray solid; -} diff --git a/intranet/modules/digicode/static/digicode.js b/intranet/modules/digicode/static/digicode.js deleted file mode 100755 index f9a471ac..00000000 --- a/intranet/modules/digicode/static/digicode.js +++ /dev/null @@ -1,160 +0,0 @@ -/* ************************************************************ - * Digicode - ************************************************************ - * Digicode.init : initialisation de la page - * Digicode.makeCode : creation de codes - * Digicode.codelist : liste des codes - * Digicode.AJAX : ajax - */ -Digicode = {}; - -/***************************** - Digicode.init - *****************************/ -Digicode.init = function() -{ - // afficher le tableau codelist - appendChildNodes("globalDiv", Digicode.codelist.create()); - // recuperer la liste des codes - this.codelist.load(); - // afficher le formulaire de creation de code - appendChildNodes("globalDiv", DIV({"id":"addCodeBox"})); - Digicode.makeCode.displayForm(); -} - -/***************************** - Digicode.makeCode - *****************************/ -Digicode.makeCode = {} - -Digicode.makeCode.displayForm = function() -{ - var myForm = FORM({'id':'createCodeForm', 'name':'createCodeForm','onsubmit':"Digicode.makeCode.createCode(document.createCodeForm.newCodeLogin.value, document.createCodeForm.newCode.value); return false;", 'style':'display: none;'}, - LABEL({'for':'newCodeLogin'}, "Login adhérent :"), - INPUT({"name":"newCodeLogin", "size":"10", "maxlength":"20", "class":"textinput"}), - BR(), - LABEL({'for':'newCode'}, "Code :"), - INPUT({"name":"newCode", "size":"6", "maxlength":"6", "class":"textinput"}), - BUTTON({"type":"submit","onclick":"Digicode.makeCode.createCode(document.createCodeForm.newCodeLogin.value, document.createCodeForm.newCode.value); return false;", "style":"float:right;"},"Créer code"), - BUTTON({"type":"button","onclick":"Digicode.makeCode.createCode(document.createCodeForm.newCodeLogin.value)", "style":"float:right;"},"Code aléatoire") - ); - replaceChildNodes("addCodeBox", H1({},"Nouveau code"), myForm ); - appear(myForm); - -} - -Digicode.makeCode.restoreForm = function() -{ - try - { - removeElement("newCodeDisplay"); - removeElement("loading"); - } catch (error){} - appear("createCodeForm"); - -} - -Digicode.makeCode.disableForm = function() -{ - try - { - var form = getElement("createCodeForm"); - var elts = form.elements; - for (i=0 ; i < elts.length ; i++) - elts[i].disabled = true; - } - catch (error){} -} - -Digicode.makeCode.createCode = function(login, code) -{ - var image = createDOM("IMG",{'style':'margin-right:2px;float:right;','src':'/static/images/indicator.gif'}); - appendChildNodes("addCodeBox", DIV({'id':"loading",'style':'display:none;max-height:1em;float:left;'},image,"Loading")); - this.disableForm(); - //removeElement("createCodeForm"); - appear("loading"); - if (code) - Digicode.AJAX.call("createCode?code="+code + "&adherent=" + login, this.handleNewCode); - else - Digicode.AJAX.call("createCode?adherent=" + login, this.handleNewCode); -} - -Digicode.makeCode.handleNewCode = function(res) -{ - if (res.code) - { - replaceChildNodes("addCodeBox", - H1({}, "Code créé"), - DIV({'id':"newCodeDisplay", - 'style':'display:none;font-size:2em;maring:1em;font-weight:bold;text-align:center;', - 'onclick':"Digicode.makeCode.displayForm();"},res.code)); - appear("newCodeDisplay"); - //removeElement("loading"); - Digicode.codelist.addCode(res); - } else if (res.erreur) { - logError("Erreur distante : " + res.erreur); - alert("Erreur sur le serveur, le code est peut-être déjà pris.") - Digicode.makeCode.displayForm(); - } else if (res.formatErreur) { - alert("Ceci n'est pas un code valide"); - Digicode.makeCode.displayForm(); - } -} - -/***************************** - Digicode.codelist - *****************************/ -Digicode.codelist = {}; - -Digicode.codelist.create = function () -{ - var thead = createDOM("thead", {}, - createDOM("th", {'class':'code'}, "Code" ), - createDOM("th", {'class':'age'}, "Age") - ); - var tbody = createDOM("tbody", {"id":"codeList"}); - return TABLE({"id":"codesTable", "cellspacing":"0"}, thead, tbody) -} - - - -Digicode.codelist.load = function() -{ - Digicode.AJAX.call("codeList", Digicode.codelist.displayCodes); -} - -Digicode.codelist.displayCodes = function(result) -{ - if (result.codes) - replaceChildNodes('codeList',map(Digicode.codelist.newCodeTrNodeFromDict,result.codes)); - else if (result.erreur) - logError("Erreur distante : " + result.erreur); -} - -Digicode.codelist.newCodeTrNodeFromDict = function (aDict, style) -{ - if (style) { - var aRow = createDOM("TR", {'id':'code'+aDict.code,"style":style}); - } else - var aRow = createDOM("TR", {'id':'code'+aDict.code}); - appendChildNodes(aRow, createDOM("TD", {'class':'code'}, aDict.code, SPAN({'style':'color:gray;margin-left:2em;'}, aDict.desc ) ) ); - appendChildNodes(aRow, createDOM("TD", {'class':'age'}, aDict.age) ); - return aRow; -} - -Digicode.codelist.addCode = function (aDict) -{ - var newLine = this.newCodeTrNodeFromDict(aDict); - appendChildNodes("codeList", newLine); - pulsate(newLine); -} - - -/***************************** - Digicode.AJAX - *****************************/ -Digicode.AJAX = {} - -Digicode.AJAX.call = AJAX.call - -setInterval(Digicode.codelist.load, 30000); diff --git a/intranet/modules/digicode/static/icon.png b/intranet/modules/digicode/static/icon.png deleted file mode 100755 index fe3729c6..00000000 Binary files a/intranet/modules/digicode/static/icon.png and /dev/null differ diff --git a/intranet/modules/digicode/templates/digicode.tmpl b/intranet/modules/digicode/templates/digicode.tmpl deleted file mode 100644 index 4da22e0f..00000000 --- a/intranet/modules/digicode/templates/digicode.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -#import digicode - -
-

Gestion des codes pour le local impression

-
- - diff --git a/intranet/modules/factures/main.py b/intranet/modules/factures/main.py deleted file mode 100755 index 551779db..00000000 --- a/intranet/modules/factures/main.py +++ /dev/null @@ -1,248 +0,0 @@ -#! /usr/bin/env python -# -*- coding: iso-8859-15 -*- -# ##################################################################################################### # -# Mes Sous -# ##################################################################################################### # -# Description: -# Affiche la liste des factures et l'historique de debits/credits de l'adherent. -# Fait aussi les rechargements Paypal -# Informations: -# -# Pages: -# index:liste des factures -# historique: historique des débits/crédits -# rechargementPaypal: Comme son nom l'indique -# -# ##################################################################################################### # -import cherrypy, sys, os, datetime - - -if (cherrypy.config.configMap["global"]["server.environment"] == "development"): - from ldap_crans_test import * -# print("monCompte : unsing test ldap : env=" + cherrypy.config.configMap["global"]["server.environment"]) -else: - from ldap_crans import * -# print("monCompte : unsing prod ldap : env=" + cherrypy.config.configMap["global"]["server.environment"]) - - -from ClassesIntranet.ModuleBase import ModuleBase - - -class main(ModuleBase): - def title(self): - return "Mon Solde" - def category(self): - return "Personnel" - def icon(self): - return "icon.png" - - _club = False - _adh = False - - - - def getCurrentAdministrativeYear(self): - ''' - premiere partie de l''annee scolaire en cours - ex : le 5 juin 2006 retourne 2005 - ''' - now = datetime.datetime.now() - currentYear = int(now.strftime("%Y")) - currentMonth = int(now.strftime("%m")) - if currentMonth > 8: - administrativeYear = currentYear - else: - administrativeYear = currentYear - 1 - return administrativeYear - - - def index(self, message = '', error = ''): - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - t = {} - t['message'] = message - t['error'] = error - - ############## liste des factures ############## - listeFactures = [] - for f in adh.factures(): - facture = {} - facture['no'] = f.numero() - facture['intitule'] = f.articles()[0]['designation'] - facture['details'] = [ - { - 'intitule':art['designation'], - 'quantite':art['nombre'], - 'prixUnitaire':art['pu'], - 'prixTotal':art['pu']*art['nombre'], - } for art in f.articles()] - facture['montant'] = f.total() - facture['paypal'] = f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False), - businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"), - return_page = "https://intranet.crans.org/monCompte/paypalReturn", - cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel", - ) - - facture['payee'] = f.recuPaiement() - listeFactures.append(facture) - t['listeFactures'] = listeFactures - - return { - 'template' :'factures', - 'values' :t, - 'stylesheets' :['cransFactures.css'], - 'scripts' :[], - } - index.exposed = True - - def historique(self, page = 1, items_per_page = 20): - 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 = [] - for anItem in lst: - aLine = {} - aLine["date"] = anItem.split(u",")[0] - aLine["type"] = anItem.split(u' : ',2)[1].split(u' ')[0] - aLine["montant"] = anItem.split(u' : ',2)[1].split(u' ')[1] - try: - aLine["intitule"] = anItem.split(u'[')[1].split(u']')[0] - except Exception: - aLine["intitule"] = "" - histLst.append(aLine) - - histLst.reverse() - page = int(page) - items_per_page = int(items_per_page) - if page == 1: - prevPage = None - else: - prevPage = page - 1 - - if page * items_per_page >= histLst.__len__(): - nextPage = None - else: - nextPage = page + 1 - offset = items_per_page * ( page - 1) - - - return { - 'template' :'factures-historique', - 'values' :{ - 'liste':lst, - 'historic_items':histLst[offset:offset + items_per_page], - 'nextPage':nextPage, - 'prevPage':prevPage - }, - 'stylesheets' :['cransFactures.css'], - 'scripts' :[], - } - historique.exposed = True - - def delFacture(self, no): - try: - # trrouver la factures - fact = cherrypy.session['LDAP'].search('fid=' + no, 'w')['facture'][0] - #verifier qu'elle appartient bien a l'adherent - if not fact.proprietaire().mail() == cherrypy.session['uid']: - raise Exception, "Impossible de supprimer cette facture" - # la supprimer - fact.delete() - except Exception, e: - cherrypy.log(str(e), "FACTURES", 1) - return self.index() - delFacture.exposed = True - - - ########################## - # paypal - ########################## - # - # methode qui affiche successivement les - # templates du popup pour recharger son compte impression - # via paypal - # - def rechargerCompteImpression(self, etape = '1', combien = None): - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - if (etape == "1"): # Introduction - return { - 'template' :'MonCompteRechargePaypal1', - 'standalone' :True, - 'values' :{}, - } - elif (etape == "2"): # choix montant - return { - 'template' :'MonCompteRechargePaypal2', - 'standalone' :True, - 'values' :{}, - } - elif (etape == "3"): # confirmer facture - # creer objet facture - f = Facture(adh) - # /!\ verifier que combien est un nombre - # et qu'il n'y a pas plus de 2 chiffres apres le point... - # (ce serait bien aussi si on pouvait mettre une virgue a la place du point) - try: - # remplacage des virgules - combien = combien.replace(u',', u'.') - # convertissage - combien = float(combien) - # arrondissage-tronquage : - combien = float(int(combien*100)/100.0) - # nombre positif - if combien < 0: - raise ValueError - except Exception: - return { - 'template' :'MonCompteRechargePaypal2', - 'standalone' :True, - 'values' :{'error':"Le montant doit être un nombre positif !", 'combien':combien}, - } - f.ajoute({'nombre': 1, 'code': 'SOLDE', 'designation': 'Credit du compte impression (intranet)', 'pu': combien}) - cherrypy.session['freshFacture'] = f - pageData = {} - pageData['details'] = [ - { - 'intitule':art['designation'], - 'quantite':art['nombre'], - 'prixUnitaire':art['pu'], - 'prixTotal':art['pu']*art['nombre'], - } for art in f.articles()] - pageData['total'] = f.total() - return { - 'template' :'MonCompteRechargePaypal3', - 'standalone' :True, - 'values' :pageData, - } - elif (etape == "4"):# payer maintenant ? - # sauver objet facture - f = cherrypy.session['freshFacture'] - f.save() - return { - 'template' :'MonCompteRechargePaypal4', - 'standalone' :True, - 'values' :{'lienPaypal' : f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False), - businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"), - return_page = "https://intranet.crans.org/monCompte/paypalReturn", - cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel", - )}, - } - rechargerCompteImpression.exposed = True - - def paypalReturn(self, **kw): - _crans_cp.log("retour de paypal avec les infos : %s" % " ".join( [ "[%s: %s]" % (str(a), str(kw[a])) for a in kw] ) ) - return { - 'template' :'MonComptePaypalReturn', - 'standalone' :True, - 'values' :{}, - } - paypalReturn.exposed = True - - def paypalCancel(self, **kw): - _crans_cp.log("annulation de paypal avec les infos : %s" % " ".join( [ "[%s: %s]" % (str(a), str(kw[a])) for a in kw] ) ) - return { - 'template' :'MonComptePaypalCancel', - 'standalone' :True, - 'values' :{}, - } - paypalCancel.exposed = True - diff --git a/intranet/modules/factures/static/cransFactures.css b/intranet/modules/factures/static/cransFactures.css deleted file mode 100755 index cc230642..00000000 --- a/intranet/modules/factures/static/cransFactures.css +++ /dev/null @@ -1,205 +0,0 @@ -/******************************************** - * -********************************************/ -#globalDiv { - //padding-left:20%; - position: relative; -} - -ul#actionMenu { - list-style-type:none; - width:18%; - padding:0; - float:left; -} - -h1 { - font-size:1.4em; - margin:2px; -} -td, tr { - margin:0; -} - -#factureListDiv { - padding:5px; - background:#fad163; - float:left; - width:75%; -} - -#factureListDiv table#listeFactures { - padding:0; - width:100%; -} - -.factureRow { - margin:2px; - position:relative; -} - -.help_text { - background:#fff7D7; - font-weight:normal; - padding:10px 20px; - -} - -.factureRow .factureSummary { - background:#fff7D7; - height:30px; - font-weight:bold; - padding:10px 20px; -} - -.factureRow .factureSummary span.intitule { - float:left; -} - -.factureRow .factureSummary span.montant { - float:right; - text-align:right; -} - -.tdNoFactures { - text-align:center; - font-size:1.2em; - background-color:#fff7D7; - color:#666; - margin:0; - padding:5px; -} - -.facturePayee { -} -.factureNonPayee .factureSummary { - color:red; -} - - -.actions { - display:block; - float:right; - font-size:0.9em; - font-weight:normal; -} -.actions a { - margin:2px 10px; -} - -/******************************************** - * -********************************************/ - -table.factureDetails { - background: #fff7D7 url(fondFacturesDetails.png) repeat-x top; - padding:1%; - width:96%; - margin:0 1% 10px 1%; -} - -.tdTotalDetail, -.tdTotalDetailIntitule { - border-top:thin black solid; -} - -.tdTotalDetailIntitule { - text-align:right; - font-weight:bold; -} - -table.factureDetails th { - border-bottom:thin black solid; -} -table.factureDetails th, -table.factureDetails td { - border-right:thin black solid; - margin:0; - padding:5px 20px; -} - -/******************************************** - * -********************************************/ -.note { - display:block; - font-size:small; - margin:3px; - font-weight:normal; -} -.note { - color:#666 -} - -.linkToggle { - display:block; - float:left; - height:15px; - width:15px; - background:transparent url(fl.png) top left; - margin-right:1px; -} - -/******************************************** - * -********************************************/ - -table#historique_sous { - width:100%; -} - -table#historique_sous td { - background:#fff7D7; - padding:5px; - text-align:center; - border-top:2px #fad163 solid; -} - -table#historique_sous th { - background:#fff7D7; - padding:5px; - text-decoration:underline; -} - -/******************************************** - * -********************************************/ - -form.search { - display:block; - border: thin black solid; - padding:.2em 1em; - float:left; - //position:absolute; - width:18%; - //top:0; - //left:0; - margin:0 1%; -} - -form.search input { - max-width:95%; - margin:.3em; - float:left; - border: thin gray solid; -} - -form.search label { - padding-top:7px; - display:block; - width:4em; - float:left; - clear:left; -font-weight:bold; -} - -form.search h3 { - margin:.2em 0; -} - -form.search input.button { - margin:.5em; - text-align:center; - clear:left; -} - diff --git a/intranet/modules/factures/static/fl.png b/intranet/modules/factures/static/fl.png deleted file mode 100755 index 2c72f9ea..00000000 Binary files a/intranet/modules/factures/static/fl.png and /dev/null differ diff --git a/intranet/modules/factures/static/fondFacturesDetails.png b/intranet/modules/factures/static/fondFacturesDetails.png deleted file mode 100755 index b747a69c..00000000 Binary files a/intranet/modules/factures/static/fondFacturesDetails.png and /dev/null differ diff --git a/intranet/modules/factures/static/icon.png b/intranet/modules/factures/static/icon.png deleted file mode 100755 index 136dec31..00000000 Binary files a/intranet/modules/factures/static/icon.png and /dev/null differ diff --git a/intranet/modules/factures/templates/factures-historique.tmpl b/intranet/modules/factures/templates/factures-historique.tmpl deleted file mode 100755 index 93b45cd3..00000000 --- a/intranet/modules/factures/templates/factures-historique.tmpl +++ /dev/null @@ -1,58 +0,0 @@ -
- -
- - - -
-

Historique

-
-
- #if $prevPage - << moins vieux - #else - << moins vieux - #end if -  |  - #if $nextPage - plus vieux >> - #else - plus vieux >> - #end if -
- - - - - - - - #for anItem in $historic_items - - - - #if $anItem.type=="debit" - - #else - - #end if - #if $anItem.type=="credit" - - #else - - #end if - - #end for - #if $historic_items == [] - - #end if -
DateIntituléDébitCrédit
$anItem.date$anItem.intitule$anItem.montant $anItem.montant 
- AUCUNE TRANSACTION ENREGISTRÉE -
-
- -
-
diff --git a/intranet/modules/factures/templates/factures.tmpl b/intranet/modules/factures/templates/factures.tmpl deleted file mode 100755 index 7551fcc8..00000000 --- a/intranet/modules/factures/templates/factures.tmpl +++ /dev/null @@ -1,107 +0,0 @@ -
- -#if $message != '' - -#end if - -#if $error != '' - -#end if - - - - -
- - -
-

Mes factures PayPal

- - #for f in $listeFactures - #if $f.payee -
- #else -
- #end if -
- - #if $f.details.__len__() > 1 - - #end if - $f.intitule - #if not $f.payee - (non payée) - #end if - - - - $f.montant € - - Crée le - - #if not $f.payee - - Annuler - Payer avec PayPal - - #else - Payée - #end if - -
- #if $f.details.__len__() > 1 - -
- #end if - #end for - - #if $listeFactures == [] -
- AUCUNE TRANSACTION PAYPAL ENREGISTRÉE -
- #end if -
- -
diff --git a/intranet/modules/gestionFactures/main.py b/intranet/modules/gestionFactures/main.py deleted file mode 100755 index 6c37b7c7..00000000 --- a/intranet/modules/gestionFactures/main.py +++ /dev/null @@ -1,147 +0,0 @@ -#! /usr/bin/env python -# -*- coding: iso-8859-15 -*- -# ##################################################################################################### # -# Factures (gestion) -# ##################################################################################################### # -# Description: -# Permet de chercher dans les facture, d'en créditer et d'en supprimer -# Informations: -# -# Pages: -# index:afiche le formulaire et les factures -# -# ##################################################################################################### # -import cherrypy, sys, os, datetime -import crans.cp, crans.utils.exceptions -from ClassesIntranet.ModuleBase import ModuleBase - -class main(ModuleBase): - _droits = ["Imprimeur"] - def title(self): - return "Gestion factures" - def category(self): - return "Imprimeur" - - def index(self, message = '', erreur = ''): - if cherrypy.session.has_key('gestion_factures-current_search'): - del cherrypy.session['gestion_factures-current_search'] - return self.displayTemplate() - index.exposed = True - - def search(self, fid=None, uid=None, aid=None): - cherrypy.session['gestion_factures-current_search'] = { - "fid":fid, - "uid":uid, - "aid":aid, - } - return self.displayTemplate() - search.exposed = True - - - - def displayTemplate(self, message = '', erreur = ''): - t = {} - t['message'] = message - t['error'] = erreur - if cherrypy.session.has_key('gestion_factures-current_search'): - fid = cherrypy.session['gestion_factures-current_search']['fid'] - uid = cherrypy.session['gestion_factures-current_search']['uid'] - aid = cherrypy.session['gestion_factures-current_search']['aid'] - t['listeFactures'] = self.buildInvoiceList( - fid = fid, - uid = uid, - aid = aid, - ) - - else: - fid = "" - uid = "" - aid = "" - t["form"] = [] - t["form"]+= [{'name':'fid', 'label':'fid', 'value':fid}] - t["form"]+= [{'name':'uid', 'label':'login', 'value':uid}] - t["form"]+= [{'name':'aid', 'label':'aid', 'value':aid}] - - return { - 'template' :'factures-gestion', - 'values' :t, - 'stylesheets' :['cransFactures.css'], - } - - - - - def buildInvoiceList(self, fid=None, uid=None, aid=None): - ############## liste des factures ############## - if fid: - search_string = "fid=%s" % str(fid) - liste_factures_ldap = cherrypy.session['LDAP'].search(search_string)['facture'] - elif uid: - search_string = "uid=%s" % str(uid) - try: - liste_factures_ldap = cherrypy.session['LDAP'].search(search_string)['adherent'][0].factures() - except: - liste_factures_ldap = [] - elif aid: - search_string = "aid=%s" % str(aid) - try: - liste_factures_ldap = cherrypy.session['LDAP'].search(search_string)['adherent'][0].factures() - except: - liste_factures_ldap = [] - else: - return [] - liste_factures_affichees = [] - for f in liste_factures_ldap: - try: - facture = {} - facture['no'] = f.numero() - proprio = f.proprietaire() - if proprio.objectClass == 'club': - proprio = proprio.responsable() - facture['adherent'] = proprio.mail() - facture['montant'] = f.total() - facture['payee'] = f.recuPaiement() - facture['date'] = f.historique()[0].split(',')[0] - facture['url'] = f.urlPaypal() - facture['intitule'] = f.articles()[0]['designation'] - facture['details'] = [ - { - 'intitule':art['designation'], - 'quantite':art['nombre'], - 'prixUnitaire':art['pu'], - 'prixTotal':art['pu']*art['nombre'], - } for art in f.articles()] - liste_factures_affichees.append(facture) - except: - crans.cp.log("Facture non affichable : fid=%s" % str(f.numero()), "GESTION FACTURES", 1) - - liste_factures_affichees.sort(lambda x,y : cmp(int (y['no']), int(x['no']))) - return liste_factures_affichees - - def delFacture(self, fid): - try: - # trrouver la factures - fact = cherrypy.session['LDAP'].search('fid=' + fid, 'w')['facture'][0] - # la supprimer - fact.delete() - except Exception, e: - crans.cp.log(unicode(e), "GESTION FACTURES", 1) - return self.index(erreur=u"Probleme lors de la suppression") - crans.cp.log(u"Facture supprimee [fid=%s]" % fid, "GESTION FACTURES") - return self.displayTemplate(message=u"Facture suprimée") - delFacture.exposed = True - - def crediteFacture(self, fid): - try: - # trrouver la factures - fact = cherrypy.session['LDAP'].search('fid=' + fid, 'w')['facture'][0] - # la supprimer - fact.recuPaiement(cherrypy.session['uid']) - fact.save() - except Exception, e: - crans.cp.log(unicode(e), "GESTION FACTURES", 1) - crans.cp.log( crans.utils.exceptions.formatExc( ), "GESTION FACTURES", 1) - return self.displayTemplate(erreur=u"Erreur: " + unicode(e) ) - crans.cp.log("Facture creditee [fid=%s]" % fid, "GESTION FACTURES") - return self.displayTemplate(message=u"Facture créditée") - crediteFacture.exposed = True diff --git a/intranet/modules/gestionFactures/static/cransFactures.css b/intranet/modules/gestionFactures/static/cransFactures.css deleted file mode 100755 index cc230642..00000000 --- a/intranet/modules/gestionFactures/static/cransFactures.css +++ /dev/null @@ -1,205 +0,0 @@ -/******************************************** - * -********************************************/ -#globalDiv { - //padding-left:20%; - position: relative; -} - -ul#actionMenu { - list-style-type:none; - width:18%; - padding:0; - float:left; -} - -h1 { - font-size:1.4em; - margin:2px; -} -td, tr { - margin:0; -} - -#factureListDiv { - padding:5px; - background:#fad163; - float:left; - width:75%; -} - -#factureListDiv table#listeFactures { - padding:0; - width:100%; -} - -.factureRow { - margin:2px; - position:relative; -} - -.help_text { - background:#fff7D7; - font-weight:normal; - padding:10px 20px; - -} - -.factureRow .factureSummary { - background:#fff7D7; - height:30px; - font-weight:bold; - padding:10px 20px; -} - -.factureRow .factureSummary span.intitule { - float:left; -} - -.factureRow .factureSummary span.montant { - float:right; - text-align:right; -} - -.tdNoFactures { - text-align:center; - font-size:1.2em; - background-color:#fff7D7; - color:#666; - margin:0; - padding:5px; -} - -.facturePayee { -} -.factureNonPayee .factureSummary { - color:red; -} - - -.actions { - display:block; - float:right; - font-size:0.9em; - font-weight:normal; -} -.actions a { - margin:2px 10px; -} - -/******************************************** - * -********************************************/ - -table.factureDetails { - background: #fff7D7 url(fondFacturesDetails.png) repeat-x top; - padding:1%; - width:96%; - margin:0 1% 10px 1%; -} - -.tdTotalDetail, -.tdTotalDetailIntitule { - border-top:thin black solid; -} - -.tdTotalDetailIntitule { - text-align:right; - font-weight:bold; -} - -table.factureDetails th { - border-bottom:thin black solid; -} -table.factureDetails th, -table.factureDetails td { - border-right:thin black solid; - margin:0; - padding:5px 20px; -} - -/******************************************** - * -********************************************/ -.note { - display:block; - font-size:small; - margin:3px; - font-weight:normal; -} -.note { - color:#666 -} - -.linkToggle { - display:block; - float:left; - height:15px; - width:15px; - background:transparent url(fl.png) top left; - margin-right:1px; -} - -/******************************************** - * -********************************************/ - -table#historique_sous { - width:100%; -} - -table#historique_sous td { - background:#fff7D7; - padding:5px; - text-align:center; - border-top:2px #fad163 solid; -} - -table#historique_sous th { - background:#fff7D7; - padding:5px; - text-decoration:underline; -} - -/******************************************** - * -********************************************/ - -form.search { - display:block; - border: thin black solid; - padding:.2em 1em; - float:left; - //position:absolute; - width:18%; - //top:0; - //left:0; - margin:0 1%; -} - -form.search input { - max-width:95%; - margin:.3em; - float:left; - border: thin gray solid; -} - -form.search label { - padding-top:7px; - display:block; - width:4em; - float:left; - clear:left; -font-weight:bold; -} - -form.search h3 { - margin:.2em 0; -} - -form.search input.button { - margin:.5em; - text-align:center; - clear:left; -} - diff --git a/intranet/modules/gestionFactures/static/fl.png b/intranet/modules/gestionFactures/static/fl.png deleted file mode 100755 index 2c72f9ea..00000000 Binary files a/intranet/modules/gestionFactures/static/fl.png and /dev/null differ diff --git a/intranet/modules/gestionFactures/static/fondFacturesDetails.png b/intranet/modules/gestionFactures/static/fondFacturesDetails.png deleted file mode 100755 index b747a69c..00000000 Binary files a/intranet/modules/gestionFactures/static/fondFacturesDetails.png and /dev/null differ diff --git a/intranet/modules/gestionFactures/static/icon.png b/intranet/modules/gestionFactures/static/icon.png deleted file mode 100644 index efe29dd9..00000000 Binary files a/intranet/modules/gestionFactures/static/icon.png and /dev/null differ diff --git a/intranet/modules/gestionFactures/templates/factures-historique.tmpl b/intranet/modules/gestionFactures/templates/factures-historique.tmpl deleted file mode 100755 index 065725d9..00000000 --- a/intranet/modules/gestionFactures/templates/factures-historique.tmpl +++ /dev/null @@ -1,45 +0,0 @@ -
- -
- - - -
-

Historique

-
- - - - - - - - #for anItem in $historic_items - - - - #if $anItem.type=="debit" - - #else - - #end if - #if $anItem.type=="credit" - - #else - - #end if - - #end for - #if $historic_items == [] - - #end if -
DateIntituléDébitCrédit
$anItem.date$anItem.intitule$anItem.montant $anItem.montant 
- AUCUNE TRANSACTION ENREGISTRÉE -
-
- -
-
diff --git a/intranet/modules/gestionFactures/templates/factures.tmpl b/intranet/modules/gestionFactures/templates/factures.tmpl deleted file mode 100755 index 7551fcc8..00000000 --- a/intranet/modules/gestionFactures/templates/factures.tmpl +++ /dev/null @@ -1,107 +0,0 @@ -
- -#if $message != '' - -#end if - -#if $error != '' - -#end if - - - - -
- - -
-

Mes factures PayPal

- - #for f in $listeFactures - #if $f.payee -
- #else -
- #end if -
- - #if $f.details.__len__() > 1 - - #end if - $f.intitule - #if not $f.payee - (non payée) - #end if - - - - $f.montant € - - Crée le - - #if not $f.payee - - Annuler - Payer avec PayPal - - #else - Payée - #end if - -
- #if $f.details.__len__() > 1 - -
- #end if - #end for - - #if $listeFactures == [] -
- AUCUNE TRANSACTION PAYPAL ENREGISTRÉE -
- #end if -
- -
diff --git a/intranet/modules/impression/main.py b/intranet/modules/impression/main.py deleted file mode 100644 index d4735bb7..00000000 --- a/intranet/modules/impression/main.py +++ /dev/null @@ -1,291 +0,0 @@ -#!/usr/bin/env python -# -*- coding: iso-8859-15 -*- -# ############################################################# -# .. -# .... ............ ........ -# . ....... . .... .. -# . ... .. .. .. .. ..... . .. -# .. .. ....@@@. .. . ........ . -# .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... -# .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... -# @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. -# .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... -# ...@@@.... @@@ .@@.......... ........ ..... .. -# . ..@@@@.. . .@@@@. .. ....... . ............. -# . .. .... .. .. . ... .... -# . . .... ............. .. ... -# .. .. ... ........ ... ... -# ................................ -# -# ############################################################# -# -# interface d'impression -# -# Copyright (c) 2006, 2007, 2008, 2009 by Cr@ns (http://www.crans.org) -# ############################################################# - -import cherrypy, tempfile, shutil, os, commands, sys, re -import crans.cp - -from threading import Thread -from re import compile - -sys.path.append('/usr/scripts/impression') -import digicode, etat_imprimante -from impression_canon import FichierInvalide,SoldeInsuffisant,impression -from traceback import format_exception - -BOOK_REGEXP = compile('book.pdf') -FILE_UPLOAD_BASE_FOLDER = cherrypy.config.get('fileUpload.folder', "/var/impression/fichiers/") - -class FileError(Exception): - pass -from ClassesIntranet.ModuleBase import ModuleBase - -def fmt_exc(e): - return '
'.join(format_exception(e)) - -# ############################################################# -# Classe d'impression en multithread -# ############################################################# -class threadedImpression(Thread, impression): - def __init__(self, path_to_pdf, adh = None, callback = None): - raise Exception('Code mort ') - self.tpath_to_pdf = path_to_pdf - self.tadh = adh - Thread.__init__(self) - - def run(self): - impression(self, self.tpath_to_pdf, self.tadh) - if self.tcallback: - self.tcallback(self) - - - -class main(ModuleBase): - def category(self): - return "Services" - def title(self): - return "Impression" - def icon(self): - return "icon.png" - _club = True - - ########################## - # affichage - ########################## - # - # template principale - # - def index(self, submit = None, fileList = None, newFile = None ): - data = {} - # on efface un eventuel objet impression existant - cherrypy.session['impression'] = None - if submit == "Envoyer": - try: - newFile.filename = re.sub("\s+", "_", newFile.filename) - newFile.filename = re.sub("[^\w\._]", "", newFile.filename) - self.savePDF(newFile) - data['fileName'] = newFile.filename.encode('ascii','replace').replace('?','_') - except FileError, e: - data['openError'] = e.args[0] - elif submit == "Choisir": - if (fileList): - data['fileName'] = fileList - else: - data['openError'] = "Choisissez un fichier" - - data['fileList'] = self.getUploadedFileListFor(cherrypy.session['uid']) - try: - etat_imprimante.etat() - except Exception, e: - data['Erreur_imprimante'] = str(e).replace("\"", "\\\"") - data['errorMsg'] = u"Imprimante injoignable" - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - if not cherrypy.config.get('crans.activate', True): - data['Erreur_imprimante'] = "Config impression" - data['errorMsg'] = cherrypy.config.get('crans.activate.errorMsg', u"Imprimante HS") - return {'template':'impression', - 'values':data, - 'stylesheets':['impression.css'], - 'scripts':['impression.js', 'popup.js'], - } - index.exposed = True - - ########################## - # devis - ########################## - # - # methode qui affiche la template du devis - # - - def devis(self): - if cherrypy.session.has_key('impression') and cherrypy.session['impression'] != None : - return { - 'template':'impression-devis', - 'values': - { - 'devis':cherrypy.session['impression'].devisDetaille(), - 'total':cherrypy.session['impression'].prix(), - 'nomFichier':cherrypy.session['impression'].fileName(), - }, - 'standalone':True, - } - else: - return { - 'template':'impression-devis', - 'values': { }, - 'standalone':True, - } - devis.exposed = True - - - ########################## - # AJAX - ########################## - # - # methode qui renvoie la liste des codes de l'adherent - # - def codeList(self): - try: - listeBrute = digicode.list_code() - # liste de la forme : - # [(code, age, description),...] - listeBrute = [item[0] for item in listeBrute if item[2] == cherrypy.session['uid']] - return {'codes': listeBrute} - except Exception, e: - crans.cp.log('erreur lors de la creation de la liste de codes :' + str(e), 'IMPRESSION', 1) - return {'erreur':str(e)} - codeList.exposed = True - - # - # methode qui indique quel fichier utiliser - # - def useFile(self, fileName): - try: - filepath = os.path.join(os.path.join(FILE_UPLOAD_BASE_FOLDER, cherrypy.session['uid']+"/"), fileName) - adh = cherrypy.session['uid'] - if cherrypy.session['estClub']: - adh = cherrypy.session['adh_uid'] + '@' + adh - cherrypy.session['impression'] = impression(filepath, adh) - crans.cp.log("useFile returns: %s" % str( cherrypy.session['impression'].pages() )) - return {'nbPages': cherrypy.session['impression'].pages()} - except FichierInvalide, e: - crans.cp.log("useFile : %s (%s)" % (str(e), e.file()), 'IMPRESSION', 1) - return {'erreur':str(e) } - except Exception, e: - crans.cp.log("useFile : %s" % str(e), 'IMPRESSION', 1) - return {'erreur':str(e) } - useFile.exposed = True - - # - # methode pour changer les parametres - # - def changeSettings(self, copies=None, couleur=None, recto_verso=None, agrafage=None, papier=None, livret=None): - if not cherrypy.session.has_key('impression') or cherrypy.session['impression'] == None : - return {'nouvPrix':0.0} - try: - nouvPrix = cherrypy.session['impression'].changeSettings(papier=papier, couleur=couleur, agrafage=agrafage, recto_verso=recto_verso, copies=int(copies), livret=livret) - crans.cp.log("changeSettings returns : %s" % str(nouvPrix)) - except Exception, e: - crans.cp.log("changeSettings : %s" % str(e), 'IMPRESSION', 1) - return {"erreur":str(e)} - return {'nouvPrix':nouvPrix} - changeSettings.exposed = True - - - # - # methode pour lancer l'impression - # - def lancerImpression(self): - try: - cherrypy.session['impression'].imprime() - except SoldeInsuffisant: - return {"SoldeInsuffisant":1} - except Exception, e: - crans.cp.log("lancerImpression : %s" % str(e), 'IMPRESSION', 1) - return {"erreur":str(e)} - crans.cp.log("impression", 'IMPRESSION') - return { - 'code':str(digicode.gen_code(cherrypy.session['uid'])) + "#", - 'code_bat_j': cherrypy.config.get('crans.impression.codes.batJ', u"Non disponible") - } - lancerImpression.exposed = True - - # - # methode pour recuperer l'etat de l'imprimante - # - def etatImprimante(self): - if not cherrypy.config.get('crans.activate', True): - return {"printer_state" : u"Système down"} - try: - return {"printer_state" : u"\\n".join(etat_imprimante.etat())} - except Exception, e: - return {"printer_state" : 'Imprimante hors ligne'} - etatImprimante.exposed = True - - # - # methode pour le solde - # - def AJAXGetSolde(self): - try: - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - return {"solde" : adh.solde() } - except Exception, e: - return {"erreur" : str(e)} - AJAXGetSolde.exposed = True - - - - - ########################## - # privees - ########################## - # - # methode pour obtenir la liste des fichiers uploadés - # - def getUploadedFileListFor(self, adh): - file_folder = os.path.join(FILE_UPLOAD_BASE_FOLDER, cherrypy.session['uid']+"/") - if not os.path.isdir(file_folder): - return [] - liste = os.listdir(file_folder) - list_pdf = [] - # exclusion des fichiers qui ne sont pas des PDF - for f in liste: - if commands.getoutput('file -ib %s' % commands.mk2arg(file_folder, f)) == "application/pdf": - if not BOOK_REGEXP.search(f): - list_pdf.append(f) - return list_pdf - - - # - # methode pour enregistrer un fichier - # - def savePDF(self, aFile): - - _, tempFileName = tempfile.mkstemp() - f = open(tempFileName, 'w+b') - size = 0 - while True: - data = aFile.file.read(1024 * 8) # Read blocks of 8KB at a time - if not data: - break - f.write(data) - size += len(data) - f.close() - if size == 0: - raise FileError("Fichier vide") - - file_folder = os.path.join(FILE_UPLOAD_BASE_FOLDER, cherrypy.session['uid']+"/") - if not os.path.isdir(file_folder): - os.makedirs(file_folder, mode=0750) - newFilePath = os.path.join(file_folder, aFile.filename.encode('ascii','replace').replace('?','_')) - shutil.move(tempFileName, newFilePath) - os.chmod(newFilePath, 0640) - crans.cp.log("New file uploaded at : %s" % newFilePath, "IMPRESSION") - return newFilePath - - - - - diff --git a/intranet/modules/impression/static/WindowTitleLogo.png b/intranet/modules/impression/static/WindowTitleLogo.png deleted file mode 100644 index d704d48e..00000000 Binary files a/intranet/modules/impression/static/WindowTitleLogo.png and /dev/null differ diff --git a/intranet/modules/impression/static/dialog-printer.png b/intranet/modules/impression/static/dialog-printer.png deleted file mode 100644 index e812c880..00000000 Binary files a/intranet/modules/impression/static/dialog-printer.png and /dev/null differ diff --git a/intranet/modules/impression/static/dialog-solde.png b/intranet/modules/impression/static/dialog-solde.png deleted file mode 100644 index a6cd9dd8..00000000 Binary files a/intranet/modules/impression/static/dialog-solde.png and /dev/null differ diff --git a/intranet/modules/impression/static/dialog-warning.png b/intranet/modules/impression/static/dialog-warning.png deleted file mode 100644 index 632f99a3..00000000 Binary files a/intranet/modules/impression/static/dialog-warning.png and /dev/null differ diff --git a/intranet/modules/impression/static/icon.png b/intranet/modules/impression/static/icon.png deleted file mode 100755 index efe62510..00000000 Binary files a/intranet/modules/impression/static/icon.png and /dev/null differ diff --git a/intranet/modules/impression/static/impression.css b/intranet/modules/impression/static/impression.css deleted file mode 100755 index e1faa7e9..00000000 --- a/intranet/modules/impression/static/impression.css +++ /dev/null @@ -1,163 +0,0 @@ -/* ****************************************** * - * - * ****************************************** */ -#globalDiv { - padding-left:200px; - position: relative; -} - -ul#actionMenu { - list-style-type:none; - position:absolute; - width:150px; - top:0; - left:0; - margin:20px; - padding:0; -} -ul#actionMenu li { - clear:both; -} -/* ****************************************** * - * - * ****************************************** */ -#fileName { - display: block; - width:150px; - text-align:center; - padding:50px 5px 5px 5px; - background: url(./pdf-icon.png) center top no-repeat; - margin:0 0 10px 0; - overflow:auto; -} - -#actionMenu li { - margin: .8em 0; -} - -#actionEtatImprimante { - padding:0.4em; - border: thin black solid; -} - -/* ******************************************* * - * - * ******************************************* */ -form#form_impression { - margin: 0px; - font-size: 100%; - min-width:600px; -} -form#form_impression #preview { - border:1px black solid; - width:150px; - height:150px; - padding:10px; - background-color:#C0C0C0; -} - -form#form_impression #rightColumn { - margin:10px 10px 10px 240px; -} - -form#form_impression #leftColumn { - float:left; - width:170px; - margin:10px; - padding:0; -} -div#prix_placeholder { - margin:6px 0; - width:170px; - min-height:16px; - padding:0; - color:gray; -} -div#prix_placeholder img { - margin-right:2px; - float:right; -} -form#form_impression fieldset fieldset { - margin:10px; -} -form#form_impression>fieldset { - position:relative; - padding:20px; -} - -.clear { - clear:both; -} - -form#form_impression .bouttons { - text-align:right; -} -form#form_impression label.labelInput { - display:block; - width:4em; - margin-right:4px; - float:left; - text-align:right; -} - -fieldset .aide { float:right; } -/* ****************************************** * - * - * ****************************************** */ -#popupFichiers { - background:#AE0F3E; - z-index:500; - float:left; - position:absolute; - min-width:450px; - top:0; - left:20%; - right:20%; - padding:0; -} -#popupFichiers #insideDiv { - background:white; - margin:2px 5px; -} -#popupFichiers #insideDiv form { - margin:2px 5px; -} -#popupFichiers h1 { - font-size:1em; - margin:0; - text-align:center; - color:white; -} -#popupFichiers h1:before { - content:url("../images/WindowTitleLogo.png"); - margin-right:5px; -} - -#popupFichiers h2 { - font-size:1.1em; - border-bottom:thin black solid; -} -#popupFichiers select, -#popupFichiers input.file { - width:100%; -} - -.button { - float:right; -} - -/* ****************************************** * - * - * ****************************************** */ -div#printingPopupContent { - background: white url("../images/printer.png") left center no-repeat;; - padding:10px 10px 10px 115px; - min-height:100px; -} - -#printingPopupContent a, -#printingPopupContent span { - display:block; - font-weight: bold; - margin:5px 0; -} diff --git a/intranet/modules/impression/static/impression.js b/intranet/modules/impression/static/impression.js deleted file mode 100755 index a6c74e20..00000000 --- a/intranet/modules/impression/static/impression.js +++ /dev/null @@ -1,407 +0,0 @@ -/* ************************************************************ - * Impression - ************************************************************ - * Impression.settings : panneau de configuration - * Impression.popup : popup - * Impression.AJAX : ajax - */ -Impression = {}; - -/***************************** - Impression.settings - *****************************/ - -Impression.settings = {}; - - // -//// images : images used for previewing -// -Impression.settings.images = [ - "portrait_couleurs_agraphediagonale.png", - "portrait_couleurs_pasdagraphes.png", - "portrait_couleurs_uneagraphe.png", - "portrait_couleurs_Deuxagraphes.png", - "portrait_couleurs_troisAgraphes.png", - "portrait_couleurs_stitching.png", - "portrait_nb_agraphediagonale.png", - "portrait_nb_pasdagraphes.png", - "portrait_nb_uneagraphe.png", - "portrait_nb_Deuxagraphes.png", - "portrait_nb_troisAgraphes.png", - "portrait_nb_stitching.png", - "portrait_transparent_couleurs.png", - "portrait_transparent_nb.png", - ]; -/* -Impression.settings.preloadImage = function(imageName) { - var image = new Image(); - image.src = "./static/"+imageName; -} - -Impression.settings.preloadAllImages = function() { - log("Preloading images..."); - map(this.preloadImage,this.images); -} -*/ - // -//// init : parse every field and display preview -// -Impression.settings.init = function () { - log("Init settings..."); - this.theform = document.form_impression; - this.disableForm(false); -} - // -//// reset : reset form and then re-init settings -// -Impression.settings.reset = function () { - log("Reset form"); - this.theform.reset(); - this.init(); - Impression.settings.update(); -} - -Impression.settings.disableForm = function(bool) -{ - log("Set Disable Form : " + bool); - var fields = this.theform.elements; - for( var i=0; i< fields.length; i++) - { - this.setDisableField( fields[i], bool ); - } -} - - // -//// getValue : parse a field and store value in fielld.name -// -Impression.settings.getValue = function(field) -{ - if (field.value) - { - this[field.name] = field.value; - log( field.name + " is now " + this[field.name]); - } - else - { - logError("Can't get fieldValue"); - } -} - // -//// getCopies : parse copies field -// -Impression.settings.getCopies = function(field) { - if ( (!field.value) || (parseInt(field.value)!=field.value-0) || (parseInt(field.value) < 1) ) - { - this.copies = 1; - logError("Can't get copies"); - } - else - { - this.copies = parseInt(field.value); - } - log("copies is now " + this.copies); -} - - // -//// setValue : set field value -// -Impression.settings.setValue = function(afield, avalue) { - afield.value = avalue; - this.getValue(afield); -} - - // -//// setDisableField : set field disabled on/off -// -Impression.settings.setDisableField = function( afield, isdisabled ) { - afield.disabled = isdisabled ; -} - - // -//// disableField : set field disabled on -// -Impression.settings.disableField = function(afield) { - this.setDisableField(afield, true); -} - - // -//// fieldChanges : when a field is changed -// -Impression.settings.update = function () { - var orientation = "portrait"; - Impression.settings.livret="False" - if (this.theform.type_impression_couleur.checked) - this.getValue(this.theform.type_impression_couleur); - else - this.getValue(this.theform.type_impression_nb); - - if (this.theform.disposition_recto.checked) - this.getValue(this.theform.disposition_recto); - else if (this.theform.disposition_recto_verso.checked) - this.getValue(this.theform.disposition_recto_verso); - else - { - this.getValue(this.theform.disposition_livret); - Impression.settings.livret="True"; - } - this.getValue(this.theform.papier); - this.getCopies(this.theform.nb_copies); - this.getValue(this.theform.agrafage); - // Contraintes - if (Impression.settings.nb_pages > 60) - { this.disableField(this.theform.disposition_livret); - this.theform.disposition_livret.checked = false } - if ( ((this.papier == "A4") && - (( (this.theform.disposition_recto.checked) && (Impression.settings.nb_pages>50) ) || - ( (this.theform.disposition_recto_verso.checked) && (Impression.settings.nb_pages>100) ) )) - || - ((this.papier == "A3") && - (( (this.theform.disposition_recto.checked) && (Impression.settings.nb_pages>30) ) || - ( (this.theform.disposition_recto_verso.checked) && (Impression.settings.nb_pages>60) ) )) - ) - { - this.setValue(this.theform.agrafage, "None"); - this.disableField(this.theform.agrafage); - this.getValue(this.theform.agrafage); - } else { - this.setDisableField(this.theform.agrafage, false); - } - if (this.papier == "A4tr" || this.papier == "A3") - { - this.theform.disposition_recto.checked = true; - this.disableField(this.theform.disposition_recto_verso); - this.disableField(this.theform.disposition_livret); - this.getValue(this.theform.disposition_recto); - } - else - { - this.setDisableField(this.theform.disposition_recto_verso, false); - this.setDisableField(this.theform.disposition_livret, false); - } - - this.updatePreview(); - Impression.AJAX.recalcPrix(); - -} - - // -//// updatePreview : update preview with new value -// -Impression.settings.updatePreview = function() -{ - var image_name = ""; - if (this.papier == "A4tr") - image_name = "portrait_transparent_" + this.type_impression + ".png"; - else - image_name = "portrait_" + this.type_impression + '_' + this.agrafes + ".png"; - var image = createDOM("IMG",{'src':'./static/'+image_name}); - log("Updating preview (new image : " + image_name + ")"); - replaceChildNodes("preview",image) -} - - -/***************************** - Impression.popup - *****************************/ -Impression.popup = {}; - -Impression.popup.popupImpression = function(code, codeJ) { - Popup.hide(); - Popup.create({}, "Impression en cours...", - DIV( - {"id":"printingPopupContent", "style":"background-image:url(./static/dialog-printer.png)"}, - SPAN("code: "+code), - SPAN("Batiment J: "+codeJ), - A({"href":"https://wiki.crans.org/VieCrans/ImpressionReseau", "class":"aide", "target":"_blank"}, "Comment récupérer mon impression ? "), - A({"href":"index", "class":"aide", "style":"text-align:right;"}, "Nouvelle impression") - ) - - ); -Popup.display(); -} - -Impression.popup.popupError = function(erreur) { - Popup.hide(); - Popup.create({}, "Erreur", - DIV({"id":"printingPopupContent", "style":"background-image:url(./static/dialog-warning.png)"}, - SPAN(erreur), - A({"href":"mailto:nounous@crans.org", "class":"crans_help aide"}, "Envoyer un rapport aux nounous"), - Popup.closeLink({"class":"aide", "style":"text-align:right;"}, "Fermer"))); - Popup.display(); -} - -Impression.popup.popupSolde = function(code) { - Popup.hide(); - Popup.create({}, "Solde insuffisant", - DIV( - {"id":"printingPopupContent", "style":"background-image:url(./static/dialog-solde.png)"}, - SPAN("pas assez de sous"), - A({"href":"https://wiki.crans.org/CransPratique/SoldeImpression", "class":"aide", "target":"_blank"}, "Comment recharger mon compte ? "), - Popup.closeLink({"class":"aide", "style":"text-align:right;"}, "Fermer"))); - Popup.display(); -} - -Impression.popup.popupCodes = function(codeList) { - Popup.hide(); - Popup.create({}, "Codes de mes impressions", - DIV( - {"id":"printingPopupContent", "style":"background-image:url(./static/dialog-lock.png)"}, - SPAN("Mes codes"), - //UL({"size":"4", "style":"width:6em;; height:4em;padding:0;margin:0;list-style-type:none;overflow:auto;"}, map(function (code) {return LI({}, code);}, codeList)), - SELECT({"size":"4", "style":"width:100%;"}, map(function (code) {return OPTION({}, code);}, codeList)), - Popup.closeLink({"class":"aide", "style":"text-align:right;"}, "Fermer"))); - Popup.display(); -} - - - -/***************************** - Impression.mesCodes - *****************************/ -Impression.mesCodes = {}; -Impression.mesCodes.getCodes = function () -{ - Impression.AJAX.call('codeList', this.displayCodes ); -} - -Impression.mesCodes.displayCodes = function (result) { - if (result.codes) - Impression.popup.popupCodes(result.codes); - else if (result.erreur) - logError('erreur distante (codeLlist) : ' + result.erreur); - else - logError('erreur bizarre (codeLlist) : '); -} - -/***************************** - Impression.AJAX - *****************************/ -Impression.AJAX = {}; - -Impression.AJAX.call = function(url,callback) { - AJAX.call( url, callback, true); -} - -Impression.AJAX.modifPrix = function( text, wheel ) -{ - if (wheel) - { - var image = createDOM("IMG",{'src':'./static/indicator.gif'}); - } - else - { - var image = new DIV({}); - } - var item = new DIV({'onclick':'Impression.AJAX.recalcPrix();'}, image, text); - replaceChildNodes("prix_placeholder",item); - log( text ); -} - -Impression.AJAX.modifNbPages = function( nbpages ) -{ - Impression.settings.nb_pages = nbpages; - replaceChildNodes("fileNbPages",nbpages); -} - -Impression.AJAX.usefile = function(filename) { - var item = new DIV({}, "Calculs en cours..."); - this.modifPrix("Analyse du fichier...", true); - this.call('useFile?fileName=' + filename,this.analysefini ); -} - -Impression.AJAX.analysefini = function(AJAXResp) -{ - logDebug('AJAX terminated (usefile)'); - if (AJAXResp.erreur) { - Impression.AJAX.modifPrix(AJAXResp.erreur, false); - Impression.popup.popupError(AJAXResp.erreur); - Impression.settings.disableForm(true); - logWarning('Erreur distante : ' + AJAXResp.erreur); - } else { - Impression.AJAX.modifPrix("Analyse terminée", true); - Impression.settings.update(); - Impression.AJAX.modifNbPages(AJAXResp.nbPages); - } -} - -Impression.AJAX.recalcPrix = function() -{ - settings = Impression.settings; - var url = "changeSettings?copies=" + settings.copies - +"&couleur="+ settings.type_impression - +"&papier="+ settings.papier - +"&recto_verso="+ settings.disposition - +"&agrafage="+ settings.agrafage - +"&livret="+ settings.livret; - this.modifPrix("Calcul en cours", true); - this.call(url, this.changePrix); -} - -Impression.AJAX.changePrix = function(AJAXResp) -{ - if (AJAXResp.erreur) { - Impression.AJAX.modifPrix(AJAXResp.erreur, false); - Impression.popup.popupError(AJAXResp.erreur); - Impression.settings.disableForm(true); - logWarning('Erreur distante : ' + AJAXResp.erreur); - } else { - Impression.AJAX.modifPrix("Coût : " + AJAXResp.nouvPrix + "€", false); - } -} - -Impression.AJAX.lancerImpression = function(AJAXResp) -{ - var url = "lancerImpression"; - Impression.settings.disableForm(true); - this.call(url, this.finImpression); -} - -Impression.AJAX.finImpression = function(AJAXResp) -{ - if (AJAXResp.erreur) { - Impression.popup.popupError(AJAXResp.erreur); - logWarning('Erreur distante : ' + AJAXResp.erreur); - } else if (AJAXResp.SoldeInsuffisant) { - Impression.popup.popupSolde(); - Impression.settings.disableForm(false); - Impression.settings.update(); - } else { - Impression.popup.popupImpression(AJAXResp.code, AJAXResp.code_bat_j); - } - Impression.AJAX.updateSolde(); -} - -Impression.AJAX.getPrinterState = function() -{ - var url = "etatImprimante"; - Impression.AJAX.call(url, Impression.AJAX.displayPrinterState); -} - -Impression.AJAX.displayPrinterState = function(AJAXResp) -{ - if (AJAXResp.erreur) { - logWarning('Erreur distante (etatImprimante) : ' + AJAXResp.erreur); - } else { - replaceChildNodes("etatImprimanteIci", AJAXResp.printer_state) - } -} - -Impression.AJAX.updateSolde = function() -{ - var url = "AJAXGetSolde"; - Impression.AJAX.call(url, Impression.AJAX.displaySolde); -} - -Impression.AJAX.displaySolde = function(AJAXResp) -{ - if (AJAXResp.erreur) { - logWarning('Erreur distante (etatImprimante) : ' + AJAXResp.erreur); - } else { - replaceChildNodes("soldePlaceHolder", AJAXResp.solde ) - } -} - -// on met a jour le status de l'imprimante toutes les 30 secondes -setInterval(Impression.AJAX.getPrinterState, 30000); -// on met a jours le solde de l'adherent toute les 5 minutes -setInterval(Impression.AJAX.updateSolde, 300000); diff --git a/intranet/modules/impression/static/indicator.gif b/intranet/modules/impression/static/indicator.gif deleted file mode 100644 index 085ccaec..00000000 Binary files a/intranet/modules/impression/static/indicator.gif and /dev/null differ diff --git a/intranet/modules/impression/static/paysage_b&w_non.png b/intranet/modules/impression/static/paysage_b&w_non.png deleted file mode 100755 index 441ac6d2..00000000 Binary files a/intranet/modules/impression/static/paysage_b&w_non.png and /dev/null differ diff --git a/intranet/modules/impression/static/paysage_couleur_non.png b/intranet/modules/impression/static/paysage_couleur_non.png deleted file mode 100755 index d3b440d7..00000000 Binary files a/intranet/modules/impression/static/paysage_couleur_non.png and /dev/null differ diff --git a/intranet/modules/impression/static/pdf-icon.png b/intranet/modules/impression/static/pdf-icon.png deleted file mode 100755 index 552079fd..00000000 Binary files a/intranet/modules/impression/static/pdf-icon.png and /dev/null differ diff --git a/intranet/modules/impression/static/popup.js b/intranet/modules/impression/static/popup.js deleted file mode 100644 index d1cb72fa..00000000 --- a/intranet/modules/impression/static/popup.js +++ /dev/null @@ -1,35 +0,0 @@ -Popup = {}; -Popup.popupNode = null; -Popup.visible = false; - -Popup.display = function() -{ - if (this.popupNode == null) { - logError("Popup not created, cannot be displayed"); - return false; - } - appendChildNodes("pageContent", this.popupNode); - this.visible = true; - // logDebug("popup visible"); -} - -Popup.create = function(options, title_popup, content) { - var inPopup = DIV({"id":"__popupInDivId", "style":"background:white;margin:2px 5px;"}, content); - var outPopup = DIV({"id":"__popupOutDivId","style":"background:#AE0F3E;z-index:500;float:left;padding:0;min-width:300px;position:fixed;top:30%;left:30%;right:30%;"}, H1({"style":"font-size:1em;margin:0;text-align:center;color:white;"}, IMG({"src":"/static/images/WindowTitleLogo.png","alt":"icon", "style":"margin:0 5px;"}), title_popup), inPopup ); - roundElement(outPopup); - logDebug("Popup \""+ title_popup +"\" created"); - this.popupNode = outPopup; -} - -Popup.hide = function() { - if (this.visible) { - removeElement(this.popupNode); - this.visible = false; - } - // logDebug("popup not visible"); -} -Popup.closeLink = function(options, text_link) { - options["href"] = "#"; - options["onclick"] = "Popup.hide()"; - return A(options, text_link); -} diff --git a/intranet/modules/impression/static/portrait_couleur_diagonale.psd b/intranet/modules/impression/static/portrait_couleur_diagonale.psd deleted file mode 100755 index 55c6280c..00000000 Binary files a/intranet/modules/impression/static/portrait_couleur_diagonale.psd and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_couleurs_Deuxagraphes.png b/intranet/modules/impression/static/portrait_couleurs_Deuxagraphes.png deleted file mode 100755 index f431ce39..00000000 Binary files a/intranet/modules/impression/static/portrait_couleurs_Deuxagraphes.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_couleurs_agraphediagonale.png b/intranet/modules/impression/static/portrait_couleurs_agraphediagonale.png deleted file mode 100755 index 25d82c81..00000000 Binary files a/intranet/modules/impression/static/portrait_couleurs_agraphediagonale.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_couleurs_pasdagraphes.png b/intranet/modules/impression/static/portrait_couleurs_pasdagraphes.png deleted file mode 100755 index 68f469cc..00000000 Binary files a/intranet/modules/impression/static/portrait_couleurs_pasdagraphes.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_couleurs_stitching.png b/intranet/modules/impression/static/portrait_couleurs_stitching.png deleted file mode 100755 index 62c2df16..00000000 Binary files a/intranet/modules/impression/static/portrait_couleurs_stitching.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_couleurs_troisAgraphes.png b/intranet/modules/impression/static/portrait_couleurs_troisAgraphes.png deleted file mode 100755 index bd7d91f0..00000000 Binary files a/intranet/modules/impression/static/portrait_couleurs_troisAgraphes.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_couleurs_uneagraphe.png b/intranet/modules/impression/static/portrait_couleurs_uneagraphe.png deleted file mode 100755 index cd7df8dc..00000000 Binary files a/intranet/modules/impression/static/portrait_couleurs_uneagraphe.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_nb_Deuxagraphes.png b/intranet/modules/impression/static/portrait_nb_Deuxagraphes.png deleted file mode 100755 index 77308966..00000000 Binary files a/intranet/modules/impression/static/portrait_nb_Deuxagraphes.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_nb_agraphediagonale.png b/intranet/modules/impression/static/portrait_nb_agraphediagonale.png deleted file mode 100755 index d76ce6fa..00000000 Binary files a/intranet/modules/impression/static/portrait_nb_agraphediagonale.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_nb_pasdagraphes.png b/intranet/modules/impression/static/portrait_nb_pasdagraphes.png deleted file mode 100755 index d58be940..00000000 Binary files a/intranet/modules/impression/static/portrait_nb_pasdagraphes.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_nb_stitching.png b/intranet/modules/impression/static/portrait_nb_stitching.png deleted file mode 100755 index ed5ee87b..00000000 Binary files a/intranet/modules/impression/static/portrait_nb_stitching.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_nb_troisAgraphes.png b/intranet/modules/impression/static/portrait_nb_troisAgraphes.png deleted file mode 100755 index cb3b5b35..00000000 Binary files a/intranet/modules/impression/static/portrait_nb_troisAgraphes.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_nb_uneagraphe.png b/intranet/modules/impression/static/portrait_nb_uneagraphe.png deleted file mode 100755 index 84191d66..00000000 Binary files a/intranet/modules/impression/static/portrait_nb_uneagraphe.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_transparent.png b/intranet/modules/impression/static/portrait_transparent.png deleted file mode 100755 index b34b64cc..00000000 Binary files a/intranet/modules/impression/static/portrait_transparent.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_transparent_couleurs.png b/intranet/modules/impression/static/portrait_transparent_couleurs.png deleted file mode 100755 index b55adf05..00000000 Binary files a/intranet/modules/impression/static/portrait_transparent_couleurs.png and /dev/null differ diff --git a/intranet/modules/impression/static/portrait_transparent_nb.png b/intranet/modules/impression/static/portrait_transparent_nb.png deleted file mode 100755 index e891650f..00000000 Binary files a/intranet/modules/impression/static/portrait_transparent_nb.png and /dev/null differ diff --git a/intranet/modules/impression/templates/impression-devis.tmpl b/intranet/modules/impression/templates/impression-devis.tmpl deleted file mode 100644 index 1b293018..00000000 --- a/intranet/modules/impression/templates/impression-devis.tmpl +++ /dev/null @@ -1,79 +0,0 @@ - - - - - Cr@ns Intranet - - - -
-

Devis pour impression

- Fichier : $getVar('nomFichier', 'XXXXX') -
- - - - - - - - - #if $getVar('devis', False) - #for anItem in $devis - - - - - - - - #end for - - - - - - #else - - #end if - -
DescriptionPrix unitaireQuantitétotal
$anItem[0]$anItem[1] €$anItem[2] - #echo str($anItem[1] * $anItem[2]) + ' €' -
- Total - $getVar('total', "XXX") €

Non disponible

-
-
- - diff --git a/intranet/modules/impression/templates/impression.tmpl b/intranet/modules/impression/templates/impression.tmpl deleted file mode 100644 index dbfa963e..00000000 --- a/intranet/modules/impression/templates/impression.tmpl +++ /dev/null @@ -1,189 +0,0 @@ -#import impression_canon - -#if $getVar('errorMsg',False) - -#end if - -

En raison des conditions climatiques, l'imprimante a -tendance à bourrer relativement souvent. Merci de prévoir vos -impressions à l'avance et de privilégier les impressions -recto-verso. En raison de ces bourrages, l'agrafage peut ne pas se faire sur -toutes les feuilles. Par ailleurs, l'inscription "Paper is out" est trompeuse. -En cas de problème, merci de contacter rapidement les imprimeurs : impression@lists.crans.org. Nous -sommes en train de rechercher une solution. Merci de votre -compréhension. Les nounous

- -
-
-
Options d'impression -
-
-
-
- -
-
Type d'impression - - -
- -
Copies et papier - - - -
- - -
- - - -
- -
Disposition - - - - aide -
-
- -
- - - -
-
-
- - -
    - #if $getVar('fileName',False) -
  • $fileName
  • -
  • pages:
  • -
    - #end if -
  • Nouvelle impression
  • -
  • Mes codes
  • -
  • - Solde: - - € -
  • - -
  • - État imprimante:
    - - -
  • - -
- -#if not $getVar('Erreur_imprimante',False) - #if not $getVar('fileName',False) -
-

Impression - Choix fichier

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

Il semblerait que l'interface d'impression ne soit -pas compatible avec internet explorer. Nous espérons pouvoir -régler ce problème au plus vite. Nous vous conseillons en attendant -d'utiliser Firefox. Les -nounous

-
-

Mes fichiers

-
- -
-
- -
-

Envoyer un fichier

-
- -
-
- -
-
-
-
-
- - #end if -
- - #if $getVar('fileName',False) - - #else - - #end if -#else - ## desactivation de l'interface si l'imprimant a un probleme - -#end if diff --git a/intranet/modules/infos/main.py b/intranet/modules/infos/main.py deleted file mode 100644 index 797773c1..00000000 --- a/intranet/modules/infos/main.py +++ /dev/null @@ -1,16 +0,0 @@ -from ClassesIntranet.ModuleBase import ModuleBase - - -class main(ModuleBase): - def category(self): - return u"Services" - def title(self): - return u"Informations utiles" - - def index(self): - return { - 'template':'info-diverses', - 'values':{}, - 'stylesheets':['infos.css'], - } - index.exposed = True diff --git a/intranet/modules/infos/static/icon.png b/intranet/modules/infos/static/icon.png deleted file mode 100755 index df73c4d5..00000000 Binary files a/intranet/modules/infos/static/icon.png and /dev/null differ diff --git a/intranet/modules/infos/static/infos.css b/intranet/modules/infos/static/infos.css deleted file mode 100644 index c2f0b785..00000000 --- a/intranet/modules/infos/static/infos.css +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************* - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... -. . .... ............. .. ... -.. .. ... ........ ... ... - ................................ - -============================================================== -mainInterface.css - Intranet Style - - Mise en page de l'accueil - - -Copyright (c) 2006 by www.crans.org - -**************************************************************/ - -div.framed_gray { - border:5px solid #e2e2e2; /* #acc0ff */ - background-color:#f2f2f2; - padding:10px; -} - -div.framed_gray fieldset { - border-width:2px; - border-style:solid none none none; - border-color:#a2a2a2; - padding:10px; - margin:10px 10px; - font-weight:bold; -} - -div.framed_gray fieldset legend { - color:#a2a2a2; -} - -div.framed_gray fieldset ul { - list-style-type:none; - margin:0; - padding:0; -} - -div.framed_gray fieldset ul li { - float:left; - height:70px; - width:100px; - margin:5px; - display:block; - text-align:center; -} - -div.framed_gray fieldset ul li span { - margin-bottom:0; - display:block; -} -div.framed_gray fieldset ul a { - color:black; - text-decoration:none; -} - -div.framed_gray fieldset ul li img { - margin:2px auto; - width:32px; - height:32px; -} diff --git a/intranet/modules/infos/templates/info-diverses.tmpl b/intranet/modules/infos/templates/info-diverses.tmpl deleted file mode 100755 index 49f6e810..00000000 --- a/intranet/modules/infos/templates/info-diverses.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -
-

Mots de passe Cr@ns

-

Pour les news

-
-
Utilisateur :
-
Vivelapa
-
Mot de passe :
-
ranoia!
-
-

Créer un compte wiki

- Depuis le campus, il faut aller sur wiki.crans.org et cliquer sur Connexion puis en créer un maintenant.
Depuis l'extérieur du campus, il faut pour cela se connecter sur zamok et exécuter creer_compte_wiki . -
diff --git a/intranet/modules/mesMachines/main.py b/intranet/modules/mesMachines/main.py deleted file mode 100644 index 6afd848e..00000000 --- a/intranet/modules/mesMachines/main.py +++ /dev/null @@ -1,268 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- -# ##################################################################################################### # -# Machines -# ##################################################################################################### # -# Description: -# Affiche la liste des machies, les infons sur une machine et permet des modifications -# Informations: -# -# Pages: -# index:liste des machines + le reste (AJAX) -# -# ##################################################################################################### # -import cherrypy, sys, os, datetime -from time import strftime, localtime, time -# libraries crans -sys.path.append('/usr/scripts/gestion/') -import crans.cp -if (cherrypy.config.configMap["global"]["server.environment"] == "development"): - from ldap_crans_test import * -# print("mesmachines : unsing test ldap : env=" + cherrypy.config.configMap["global"]["server.environment"]) -else: - from ldap_crans import * -# print("mesmachines : unsing prod ldap : env=" + cherrypy.config.configMap["global"]["server.environment"]) - -from ClassesIntranet.ModuleBase import ModuleBase - -class NotYourStuff(Exception): - """Erreur levée si l'adhérent essaye de modifier une machine qu'il n'est pas une des siennes""" - pass - -class main(ModuleBase): - _droits = ["personnel"] - def title(self): - return "Mes Machines" - def icon(self): - return "machines_icon_fixe.png" - - _club = True - - def AJAXListeMachines(self): - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - machines = [] - for une_machine in adh.machines(): - machineInfos = {} - # nom, mac, mid, ip - machineInfos['nom'] = une_machine.nom() - machineInfos['nomCourt'] = une_machine.nom().split('.',1)[0] - machineInfos['mid'] = une_machine.id() - # type - if une_machine.objectClass == 'machineFixe': - machineInfos['type'] = 'fixe' - #machineInfos['type'] = 'Machine fixe' - else: - machineInfos['type'] = 'wifi' - #machineInfos['type'] = 'Machine wifi' - # clef ipsec - machines.append(machineInfos) - - return {"machines":machines} - AJAXListeMachines.exposed = True - - def AJAXMachineInfo(self, mid): - try: - machine = cherrypy.session['LDAP'].search('mid=' + mid)['machine'][0] - try: - compte_machine = machine.proprietaire().compte() - except: - raise NotYourStuff("Il semble que vous cherchiez à modifier une machine dont le propriétaire n'a pas de compte Cr@ns…") - if compte_machine != cherrypy.session['uid']: - raise NotYourStuff("Vous ne pouvez pas modifier cette machine") - # zamok -> pour tester l'affichage des ports, des alias - #machine = cherrypy.session['LDAP'].search('mid=896')['machine'][0] - machineInfos = {} - # nom, mac, mid, ip - machineInfos['nom'] = machine.nom() - machineInfos['nomCourt'] = machine.nom().split('.',1)[0] - machineInfos['mac'] = machine.mac() - machineInfos['mid'] = machine.id() - machineInfos['ip'] = machine.ip() - machineInfos['ipv6'] = str(machine.ipv6()) - machineInfos['dnsIpv6'] = str(machine.dnsIpv6()) - # type - if machine.objectClass == 'machineFixe': - machineInfos['type'] = 'fixe' - else: - machineInfos['type'] = 'wifi' - # clef ipsec - try: - machineInfos['ipsec'] = machine.ipsec() - except: - machineInfos['ipsec'] = '' - # alias - machineInfos['alias'] = machine.alias() - # blacklists - machineInfos['blacklist'] = [] - for blacklist_type in machine.blacklist_all()[0].keys(): - for (begin, end) in machine.blacklist_all()[0][blacklist_type]: - blacklist = {} - blacklist['begin'] = strftime('%d/%m/%Y %H:%M', localtime(int(begin))) - blacklist['end'] = strftime('%d/%m/%Y %H:%M', localtime(int(end))) - blacklist['type'] = blacklist_type - blacklist['actif'] = 1 - machineInfos['blacklist'].append(blacklist) - for blacklist_type in machine.blacklist_all()[1].keys(): - for (begin, end) in machine.blacklist_all()[1][blacklist_type]: - blacklist = {} - blacklist['begin'] = strftime('%d/%m/%Y %H:%M', localtime(int(begin))) - blacklist['end'] = strftime('%d/%m/%Y %H:%M', localtime(int(end))) - blacklist['type'] = blacklist_type - blacklist['actif'] = 0 - machineInfos['blacklist'].append(blacklist) - # ports - machineInfos['ports'] = [] - if machine.portTCPin() != []: - machineInfos['ports'].append( - { - 'titre':'Ports TCP ouverts ext->machine', - 'ports':machine.portTCPin() - } - ) - if machine.portTCPout() != []: - machineInfos['ports'].append( - { - 'titre':'Ports TCP ouverts machine->ext', - 'ports':machine.portTCPout() - } - ) - if machine.portUDPin() != []: - machineInfos['ports'].append( - { - 'titre':'Ports UDP ouverts ext->machine', - 'ports':machine.portUDPin() - } - ) - if machine.portUDPout() != []: - machineInfos['ports'].append( - { - 'titre':'Ports TCP ouverts machine->ext', - 'ports':machine.portUDPout() - } - ) - - return machineInfos - except Exception, e: - return {"erreur":str(e)} - AJAXMachineInfo.exposed = True - - ########################## - # affichage - ########################## - # - # methode qui affiche la template - # - def index(self): - return { - 'template' :'machines', - 'values' :{}, - 'stylesheets' :['machines.css'], - 'scripts':['machines.js'], - } - index.exposed = True - - - ########################################################################### - # methodes pour changer - # des valeurs - ########################################################################### - # - - ########################## - # machine:nom - ########################## - def AJAXChangerNom(self, mid, nouveauNom): - try: - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - mach = cherrypy.session['LDAP'].search('mid=' + mid, 'w')['machine'][0] - # tester si c'est bien la machine de l'adherent - if mach.proprietaire().compte() != cherrypy.session['uid']: - del adh, mach - raise Exception(u"L'uid de l'adherent ne correspond pas au proprietaire de la machine.") - anciennom = mach.nom() - nouveauNom = mach.nom(nouveauNom) - mach.save() - del mach - except ValueError, e: - raise e - #return {'error':str(e)} - crans.cp.log("Changer nom machine : %s->%s" % (anciennom, nouveauNom), "MESMACHINES") - return {'message':u"Modification réussie", 'mid':mid} - AJAXChangerNom.exposed = True - - ########################## - # machine:mac - ########################## - def AJAXchangerMAC(self, mid, nouvelleMAC): - try: - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - mach = cherrypy.session['LDAP'].search('mid=' + mid, 'w')['machine'][0] - # tester si c'est bien la machine de l'adherent - if mach.proprietaire().compte() != cherrypy.session['uid']: - del adh, mach - raise Exception(u"L'uid de l'adherent ne correspond mas au proprietaire de la machine.") - anciennemac = mach.mac() - nommachine = mach.nom() - mach.mac(nouvelleMAC) - mach.save() - del mach - except ValueError, e: - return {'error':e.args[0]} - crans.cp.log("Change mac machine %s : %s->%s" % (nommachine, anciennemac, nouvelleMAC), "MESMACHINES") - return {'message':u"Modification réussie", 'mid':mid} - AJAXchangerMAC.exposed = True - - - - ########################## - # machine:suppression - ########################## - def AJAXSupprimerMachine(self, mid): - try: - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - mach = cherrypy.session['LDAP'].search('mid=' + mid, 'w')['machine'][0] - # tester si c'est bien la machine de l'adherent - if mach.proprietaire().compte() != cherrypy.session['uid']: - del adh, mach - raise Exception(u"L'uid de l'adherent ne correspond mas au proprietaire de la machine.") - mach.delete() - except ValueError, e: - return {'error':e.args[0]} - crans.cp.log("Machine supprimee", "MACHINES") - return {'message':u"Machine supprimée"} - AJAXSupprimerMachine.exposed = True - - ########################## - # machine:creation - ########################## - def AJAXCreerMachine(self, nomNouvelleMachine, MACNouvelleMachine, typeNouvelleMachine): - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - est_personnel = adh.etudes(0) == 'Personnel ENS' - if est_personnel and typeNouvelleMachine == 'wifi': - return {'error':'Vous n\'avez pas la possibilite d\'enregistrer de machine WiFi.'} - if typeNouvelleMachine=='fixe' and (isinstance(adh,Adherent) and adh.droits() == []) and adh.machines_fixes() != [] and not est_personnel: - return {'error':'Vous avez deja une machine fixe. Vous ne pouvez ajouter que des machines WiFi.'} - try: - if typeNouvelleMachine=='wifi': - m = MachineWifi(adh) - elif typeNouvelleMachine=='fixe': - m = MachineFixe(adh) - else: - raise Exception, "type de machine inconnu : %s " % typeNouvelleMachine - m.nom(nomNouvelleMachine) - m.mac(MACNouvelleMachine) - m.ip("") - message = m.save() - del m - except ValueError, e: - try: - del m - except: - pass - return {'error':e.args[0].replace("\n","\\n")} - crans.cp.log("Nouvelle machine %s" % nomNouvelleMachine, "MACHINES") - return {'message':u"Machine enregistrée avec succès"} - AJAXCreerMachine.exposed = True - - - diff --git a/intranet/modules/mesMachines/static/machines.css b/intranet/modules/mesMachines/static/machines.css deleted file mode 100755 index b25aba27..00000000 --- a/intranet/modules/mesMachines/static/machines.css +++ /dev/null @@ -1,160 +0,0 @@ -/************************************************************* - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... -. . .... ............. .. ... -.. .. ... ........ ... ... - ................................ - -============================================================== -macines.css - Intranet Style - -Copyright (c) 2006 by www.crans.org - -**************************************************************/ -#globalDiv { - padding-left : 20%; - margin:0; - position:relative; -} -h2 { - margin: 0 5px .5em 5px;padding:5px; -} - -div.alias { - color:gray; - margin:0; - padding:0 0 0 60px; - display:block; - font-weight:normal; - font-size:0.6em; - -} - -table.blacklist_table, -table.ports_table { - border-top: thin black solid; - border-left: thin black solid; -} - -table.blacklist_table td, -table.blacklist_table th, -table.ports_table td, -table.ports_table th { - border-right: thin black solid; - border-bottom: thin black solid; - padding: 3px; -} - -.actif { - color:red; -} -.inactif { -} - - -#gestion_machines_main_frame { - padding:5px; -} - -dl.basicInfos dt { - float:left; - font-weight:bold; - clear:left; -} - -dl.basicInfos dd { - float:left; - margin:0 1em; -} - -ul#listeMachines { - list-style-type:none; - margin:0; - padding:0; -} - -ul#listeMachines li { - float:left; - height:70px; - width:100px; - margin:5px; - display:block; - text-align:center; -} - -ul#listeMachines li span { - margin-bottom:0; - display:block; -} - -ul#listeMachines li a { -display:block; - color:black; - text-decoration:none; -} - -ul#listeMachines li a:hover { - background:#bbbbff; -} - -ul#listeMachines li a:active { - background:#8888ff; -} - -ul#listeMachines li img { - margin:2px auto; - width:32px; - height:32px; -} - -#menu_actions { - background:#eeeeff; - padding:.3em; - width:18%; - float:left; - position:absolute; - top:1em; - left:0; - border: thin black solid; -} - -#menu_actions ul { - list-style-type:none; - padding:0; - margin:.5em; -} -#menu_actions ul li a { - text-decoration:none; -} -#menu_actions ul li a:hover { - text-decoration:underline; -} - -#menu_actions h1 { - font-size:1em; - margin:0; - text-align:center; - border-bottom: thin black solid; -} - -// on change la couleur des messages -.message { - background-color:#000080; - color:white; -} - -label { - width:175px; - display:block; - float:left; -} diff --git a/intranet/modules/mesMachines/static/machines.js b/intranet/modules/mesMachines/static/machines.js deleted file mode 100755 index 59123c63..00000000 --- a/intranet/modules/mesMachines/static/machines.js +++ /dev/null @@ -1,337 +0,0 @@ -/* ************************************************************ - * Machines - ************************************************************ - * Machines.init : initialisation de la page - * Machines.listeMachines : liste des machines - * Machines.infoPane : information sur une machine - * Machines.actions : modifications, ajout... - * Machines.AJAX : ajax - */ -Machines = {}; - -/***************************** - Machines.init - *****************************/ -Machines.init = function() -{ - // afficher le tableau codelist - appendChildNodes("globalDiv", Machines.createFrames()); - appendChildNodes("globalDiv", Machines.actions.makeMenu()); - // recuperer la liste des codes - this.listeMachines.load(); -} - -Machines.createFrames = function() -{ - var main = DIV({"id":"gestion_machines_main_frame"}); - var inside = DIV({"id":"__insideDivId", "style":"background:white;margin:5px;padding:5px;"},main); - var outside = DIV({"id":"__outsideDivId","style":"background:#000080;z-index:500;padding:0;"}, inside ); - roundElement(outside); - roundElement(inside); - log("Creation du cadre"); - return outside -} - -/***************************** - Machines.listeMachines - *****************************/ -Machines.listeMachines = {}; - - -Machines.listeMachines.load = function() -{ - Machines.AJAX.call("AJAXListeMachines", Machines.listeMachines.display); - log("Chargement liste..."); - Machines.currentMachine = ''; -} - -Machines.listeMachines.display = function(result) -{ - log("display liste"); - - replaceChildNodes( "gestion_machines_main_frame", - H2({}, "Mes machines"), - UL({"id":"listeMachines"}), - DIV( {"style":"clear:both;"} ) - ); - if (result.machines) { - replaceChildNodes('listeMachines',map(Machines.listeMachines.newMachineNodeFromDict ,result.machines)); - Machines.actions.updateMenu(Machines.actions.actionForMachineList); - Machines.currentMid = ''; - } - else if (result.erreur) - logError("Erreur distante : " + result.erreur); - else - logError("Probleme bizarre..."); -} - -Machines.listeMachines.newMachineNodeFromDict = function (aDict, style) -{ - var nom = aDict.nomCourt; - var mid = aDict.mid; - var image = "machines_icon_" + aDict.type + ".png"; - //log("create an item : " + nom); - if (style) { - var anIcon = LI({'id':'machine_' + mid,"style":style}); - } else - var anIcon = LI( {'id':'machine_' + mid} ); - appendChildNodes(anIcon, A({"href":"#", "onclick":"Machines.infoPane.loadInfo('"+mid+"');return false;"}, - IMG({"src":"static/" + image}), - SPAN({},nom) ) ); - return anIcon; -} - -/***************************** - Machines.infoPane - *****************************/ -Machines.infoPane = {}; - -Machines.infoPane.loadInfo = function(mid) -{ - if (!mid) - if (!Machines.currentMachine) { - logError("Machines.infoPane.loadInfo : pas de mid, pas de machine courrante..."); - return - } else - mid = Machines.currentMachine.mid; - - log("load info : " + mid); - Machines.AJAX.call("AJAXMachineInfo?mid=" + mid, Machines.infoPane.display); - try { - pulsate('machine_' + mid); - } catch (error) {} -} - -Machines.infoPane.display = function(result) -{ - if (result.nom) { - log("displaying info : " + result.mid); - // building pane - var machinePane = DIV({"id":"machine_pane"}); - - // lien pour retourner a la liste des machines - var back_link = A({"href":"#", "onclick":"Machines.listeMachines.load(); return false;"},"Retour"); - appendChildNodes( machinePane, back_link ); - - // titre (nom de machine + alias) - var title = H2({}, IMG({"src":"./static/machines_icon_" + result.type + ".png"}), " ", result.nom); - var alias = DIV({"class":"alias"}, - map(function(a_name) { return SPAN({}, a_name + " ")}, result.alias)); - appendChildNodes( title, alias ); - appendChildNodes( machinePane, title ); - - // infos de base (type, mac, ip, ipsec...) - var basicInfos = createDOM("DL", {"class":"basicInfos"}); - appendChildNodes(basicInfos, createDOM("DT", "type:" ), createDOM("DD",{},"Machine " + result.type ) ); - appendChildNodes(basicInfos, createDOM("DT", "mac: " ), createDOM("DD",{},result.mac ) ); - appendChildNodes(basicInfos, createDOM("DT", "ip: " ), createDOM("DD",{},result.ip ) ); - appendChildNodes(basicInfos, createDOM("DT", "ipv6: " ), createDOM("DD",{},result.ipv6 ) ); - appendChildNodes(basicInfos, createDOM("DT", "accessible directement en ipv6: " ), createDOM("DD",{},result.dnsIpv6 ) ); - if (result.ipsec) { - appendChildNodes(basicInfos, createDOM("DT", "Clef Wifi:" ), createDOM("DD",{},result.ipsec, BR(), A({'href': 'http://wifi.crans.org/#Config'}, 'Comment configurer ma machine'))); - // http://wifi.crans.org/#Config - } - appendChildNodes( machinePane, basicInfos ); - appendChildNodes( machinePane, DIV( {"style":"clear:both;"} ) ); - - - // blacklist - if (result.blacklist) - if (result.blacklist.length) { - var subtitle = H3({}, "Blacklist"); - appendChildNodes( machinePane, subtitle ); - var blacklist_table = TABLE({"class":"blacklist_table", "cellspacing":"0"}, - THEAD({}, - TH({}, "Cause"), - TH({}, "Debut"), - TH({}, "Fin") - ) - ); - map(function(a_blacklist_dict) { - var style = "inactif"; - if (a_blacklist_dict.actif) - style = "actif"; - var line = TR({"class":style}, - TD({}, a_blacklist_dict.type), - TD({}, a_blacklist_dict.begin), - TD({}, a_blacklist_dict.end) - ); - appendChildNodes(blacklist_table, line); - }, result.blacklist ); - appendChildNodes( machinePane, blacklist_table ); - } - // liste des ports ouverts - if (result.ports) - if (result.ports.length) { - var subtitle = H3({}, "Ports ouverts"); - appendChildNodes( machinePane, subtitle ); - var port_table = TABLE({"class":"ports_table", "cellspacing":"0"}); - map(function(a_port_dict) { - var line = TR({}, - TH({}, a_port_dict.titre), - map(function(a_port) {return TD({}, a_port);}, a_port_dict.ports) - ); - appendChildNodes(port_table, line); - }, result.ports ); - appendChildNodes( machinePane, port_table ); - } - - // attaching pane to document - replaceChildNodes( "gestion_machines_main_frame", machinePane); - // updationg actions - Machines.currentMachine = result; - Machines.actions.updateMenu(Machines.actions.actionsForInfoPane); - } else if (result.erreur) { - logError("Erreur distante : " + result.erreur); - } else - logError("Probleme bizarr..."); - -} - -/***************************** - Machines.actions - *****************************/ -Machines.actions = {} - -Machines.actions.disponibles = -{ - 'Ajouter machine fixe':'Machines.actions.formulaire.nouvelleMachine(\'fixe\');', - 'Ajouter machine wifi':'Machines.actions.formulaire.nouvelleMachine(\'wifi\');', - 'Modifier Mac':'Machines.actions.formulaire.modifierMac(Machines.currentMid);', - 'Renommer':'Machines.actions.formulaire.renommer(Machines.currentMid);', - 'Supprimer':'Machines.actions.formulaire.supprimer(Machines.currentMid);', - 'Demander l\'ouverture d\'un port':'Machines.actions.formulaire.ouverturePort(Machines.currentMid);' -} -Machines.actions.actionForMachineList = ['Ajouter machine fixe', 'Ajouter machine wifi']; -Machines.actions.actionsForInfoPane = ['Modifier Mac', 'Renommer', 'Supprimer']; - -Machines.actions.makeMenu = function(actionListe) -{ - log("building action menu"); - var liste = UL({"id":"liste_actions"}); - //this.updateMenu(actionListe, liste) - return DIV( {"id":"menu_actions"}, - H1( {}, "ACTIONS"), - liste - ); -} - -Machines.actions.updateMenu = function(actionListe, liste_actionsNode) -{ - if (!liste_actionsNode) - liste_actionsNode = "liste_actions"; - replaceChildNodes(liste_actionsNode); - map( - function(actionName) { - appendChildNodes(liste_actionsNode, LI({}, Machines.actions.makeActionLink(actionName))); - } - , actionListe); -} - -Machines.actions.makeActionLink = function(actionName) -{ - if (this.disponibles[actionName]) - { - return A({"href":"#", "onclick":this.disponibles[actionName] + "return false;"}, actionName); - } else - logError("action inconnue " + actionName); - return A({}, "???"); -} - - - -Machines.actions.callback = function(result) { - if (result.message){ - log(result.message); - Crans.messages.setMessage(result.message); - if (result.mid) - Machines.infoPane.loadInfo(result.mid); - else - Machines.listeMachines.load(); - } - if (result.error){ - alert(result.error); - logError("AJAX error"); - } -} - -// actions : affichage des formulaires -Machines.actions.formulaire = {} -Machines.actions.formulaire.modifierMac = function() -{ - if (!Machines.currentMachine) - logError("pas de machine courrante"); - else { - var c = ''; - while ( c == '') - c = prompt("Adresse MAC de la machine :",Machines.currentMachine.mac); - if (c == null) - return false; - // AJAX stuff - Machines.AJAX.call('AJAXchangerMAC?nouvelleMAC=' + c + '&mid=' + Machines.currentMachine.mid, - Machines.actions.callback); - } - return false; -} -Machines.actions.formulaire.renommer = function() { - if (!Machines.currentMachine) - logError("pas de machine courrante"); - else { - var c = ''; - while ( c == '') - c = prompt("Nom de la machine :",Machines.currentMachine.nomCourt); - if (c == null) - return false; - // AJAX stuff - Machines.AJAX.call('AJAXChangerNom?nouveauNom=' + c + '&mid=' + Machines.currentMachine.mid, - Machines.actions.callback); - } - return false; -} -Machines.actions.formulaire.supprimer = function() { - if (!Machines.currentMachine) - logError("pas de machine courrante"); - else { - if (confirm("Supprimer la machine " + Machines.currentMachine.nomCourt +" ?")) { - // AJAX stuff - Machines.AJAX.call('AJAXSupprimerMachine?mid=' + Machines.currentMachine.mid, - Machines.actions.callback); - } - } - return false; -} - -Machines.actions.formulaire.nouvelleMachine = function(type) { - replaceChildNodes( "gestion_machines_main_frame", - A({"href":"#", "onclick":"Machines.listeMachines.load(); return false;"},"Retour"), - H2({}, "Nouvelle machine"), - FORM({"style":"clear:both;", 'onsubmit':'Machines.actions.creerMachine(this.typeField.value, this.nom.value, this.mac.value);return false;'}, - createDOM('label', {'for':'add_machine_nom'}, "Nom de la machine : "), - INPUT({"name":"nom"}), - BR(), - createDOM('label', {'for':'add_machine_mac'}, "Adresse MAC : "), - INPUT({"name":"mac"}), - BR(), - createDOM('label', {'for':'add_machine_type'}, "Type de machine : "), - SPAN({'id':'add_machine_type'}, type), - INPUT({"name":"typeField", 'type':'hidden', 'value':type}), - BR(), - BUTTON({"class":"liens", 'type':'submit'}, 'Ajouter') - ) - ); - return false; -} - -Machines.actions.creerMachine = function(type, nom, mac) { - Machines.AJAX.call('AJAXCreerMachine?nomNouvelleMachine=' + nom - + '&MACNouvelleMachine=' + mac - + '&typeNouvelleMachine=' + type, - Machines.actions.callback); -} - -/***************************** - Machines.AJAX - *****************************/ -Machines.AJAX = {} - -Machines.AJAX.call = AJAX.call diff --git a/intranet/modules/mesMachines/static/machines_icon_fixe.png b/intranet/modules/mesMachines/static/machines_icon_fixe.png deleted file mode 100644 index 11ffbb71..00000000 Binary files a/intranet/modules/mesMachines/static/machines_icon_fixe.png and /dev/null differ diff --git a/intranet/modules/mesMachines/static/machines_icon_wifi.png b/intranet/modules/mesMachines/static/machines_icon_wifi.png deleted file mode 100644 index caca9a1d..00000000 Binary files a/intranet/modules/mesMachines/static/machines_icon_wifi.png and /dev/null differ diff --git a/intranet/modules/mesSous/main.py b/intranet/modules/mesSous/main.py deleted file mode 100755 index e08fd222..00000000 --- a/intranet/modules/mesSous/main.py +++ /dev/null @@ -1,247 +0,0 @@ -#! /usr/bin/env python -# -*- coding: iso-8859-15 -*- -# ######################################################################## -# Mes Sous -# ######################################################################## -# Description: -# Affiche la liste des factures et l'historique de debits/credits de -# l'adherent. Fait aussi les rechargements Paypal -# Informations: -# -# Pages: -# index:liste des factures -# historique: historique des débits/crédits -# rechargementPaypal: Comme son nom l'indique -# -# ######################################################################## -import cherrypy, sys, os, datetime - - -if (cherrypy.config.configMap["global"]["server.environment"] == "development"): - from ldap_crans_test import * -# print("monCompte : unsing test ldap : env=" + cherrypy.config.configMap["global"]["server.environment"]) -else: - from ldap_crans import * -# print("monCompte : unsing prod ldap : env=" + cherrypy.config.configMap["global"]["server.environment"]) - - -from ClassesIntranet.ModuleBase import ModuleBase - - -class main(ModuleBase): - def title(self): - return "Mon Solde" - def category(self): - return "Personnel" - def icon(self): - return "icon.png" - _club = True - - - def getCurrentAdministrativeYear(self): - ''' - premiere partie de l''annee scolaire en cours - ex : le 5 juin 2006 retourne 2005 - ''' - now = datetime.datetime.now() - currentYear = int(now.strftime("%Y")) - currentMonth = int(now.strftime("%m")) - if currentMonth > 8: - administrativeYear = currentYear - else: - administrativeYear = currentYear - 1 - return administrativeYear - - - def index(self, message = '', error = ''): - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - t = {} - t['message'] = message - t['error'] = error - t['solde'] = adh.solde - - ############## liste des factures ############## - listeFactures = [] - for f in adh.factures(): - facture = {} - facture['no'] = f.numero() - facture['intitule'] = f.articles()[0]['designation'] - facture['details'] = [ - { - 'intitule':art['designation'], - 'quantite':art['nombre'], - 'prixUnitaire':art['pu'], - 'prixTotal':art['pu']*art['nombre'], - } for art in f.articles()] - facture['montant'] = f.total() - facture['paypal'] = f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False), - - businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"), - return_page = "https://intranet.crans.org/monCompte/paypalReturn", - cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel", - ) - - facture['payee'] = f.recuPaiement() - listeFactures.append(facture) - t['listeFactures'] = listeFactures - - return { - 'template' :'factures', - - 'values' :t, - 'stylesheets' :['cransFactures.css'], - 'scripts' :[], - } - index.exposed = True - - def historique(self, page = 1, items_per_page = 20): - 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 = [] - for anItem in lst: - aLine = {} - aLine["date"] = anItem.split(u",")[0] - aLine["type"] = anItem.split(u' : ',2)[1].split(u' ')[0] - aLine["montant"] = anItem.split(u' : ',2)[1].split(u' ')[1] - try: - aLine["intitule"] = anItem.split(u'[')[1].split(u']')[0] - except Exception: - aLine["intitule"] = "" - histLst.append(aLine) - - histLst.reverse() - page = int(page) - items_per_page = int(items_per_page) - if page == 1: - prevPage = None - else: - prevPage = page - 1 - - if page * items_per_page >= histLst.__len__(): - nextPage = None - else: - nextPage = page + 1 - offset = items_per_page * ( page - 1) - - - return { - 'template' :'factures-historique', - 'values' :{ - 'liste':lst, - 'historic_items':histLst[offset:offset + items_per_page], - 'nextPage':nextPage, - 'prevPage':prevPage - }, - 'stylesheets' :['cransFactures.css'], - 'scripts' :[], - } - historique.exposed = True - - def delFacture(self, no): - try: - # trrouver la factures - fact = cherrypy.session['LDAP'].search('fid=' + no, 'w')['facture'][0] - #verifier qu'elle appartient bien a l'adherent - if not fact.proprietaire().mail() == cherrypy.session['uid']: - raise Exception, "Impossible de supprimer cette facture" - # la supprimer - fact.delete() - except Exception, e: - cherrypy.log(str(e), "FACTURES", 1) - return self.index() - delFacture.exposed = True - - - ########################## - # paypal - ########################## - # - # methode qui affiche successivement les - # templates du popup pour recharger son compte impression - # via paypal - # - def rechargerCompteImpression(self, etape = '1', combien = None): - adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid']) - if (etape == "1"): # Introduction - return { - 'template' :'MonCompteRechargePaypal1', - 'standalone' :True, - 'values' :{}, - } - elif (etape == "2"): # choix montant - return { - 'template' :'MonCompteRechargePaypal2', - 'standalone' :True, - 'values' :{}, - } - elif (etape == "3"): # confirmer facture - # creer objet facture - f = Facture(adh) - # /!\ verifier que combien est un nombre - # et qu'il n'y a pas plus de 2 chiffres apres le point... - # (ce serait bien aussi si on pouvait mettre une virgue a la place du point) - try: - # remplacage des virgules - combien = combien.replace(u',', u'.') - # convertissage - combien = float(combien) - # arrondissage-tronquage : - combien = float(int(combien*100)/100.0) - # nombre positif - if combien < 0: - raise ValueError - except Exception: - return { - 'template' :'MonCompteRechargePaypal2', - 'standalone' :True, - 'values' :{'error':"Le montant doit être un nombre positif !", 'combien':combien}, - } - f.ajoute({'nombre': 1, 'code': 'SOLDE', 'designation': 'Credit du compte impression (intranet)', 'pu': combien}) - cherrypy.session['freshFacture'] = f - pageData = {} - pageData['details'] = [ - { - 'intitule':art['designation'], - 'quantite':art['nombre'], - 'prixUnitaire':art['pu'], - 'prixTotal':art['pu']*art['nombre'], - } for art in f.articles()] - pageData['total'] = f.total() - return { - 'template' :'MonCompteRechargePaypal3', - 'standalone' :True, - 'values' :pageData, - } - elif (etape == "4"):# payer maintenant ? - # sauver objet facture - f = cherrypy.session['freshFacture'] - f.save() - return { - 'template' :'MonCompteRechargePaypal4', - 'standalone' :True, - 'values' :{'lienPaypal' : f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False), - businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"), - return_page = "https://intranet.crans.org/monCompte/paypalReturn", - cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel", - )}, - } - rechargerCompteImpression.exposed = True - - def paypalReturn(self, **kw): - _crans_cp.log("retour de paypal avec les infos : %s" % " ".join( [ "[%s: %s]" % (str(a), str(kw[a])) for a in kw] ) ) - return { - 'template' :'MonComptePaypalReturn', - 'standalone' :True, - 'values' :{}, - } - paypalReturn.exposed = True - - def paypalCancel(self, **kw): - _crans_cp.log("annulation de paypal avec les infos : %s" % " ".join( [ "[%s: %s]" % (str(a), str(kw[a])) for a in kw] ) ) - return { - 'template' :'MonComptePaypalCancel', - 'standalone' :True, - 'values' :{}, - } - paypalCancel.exposed = True - diff --git a/intranet/modules/mesSous/templates/MonComptePaypalCancel.tmpl b/intranet/modules/mesSous/templates/MonComptePaypalCancel.tmpl deleted file mode 100644 index eba66923..00000000 --- a/intranet/modules/mesSous/templates/MonComptePaypalCancel.tmpl +++ /dev/null @@ -1,22 +0,0 @@ -#import cherrypy -#set bugMail = cherrypy.config.get("mail.bugreport", "nounous@crans.org") - - -#include "inc-paypal-head.tmpl" - - -
-

Paiement annulé

-

Ton compte impressions sera crédité dés que la facture sera réglée.

-

Tu peux régler la facture plus tard en allant dans Mes Factures

-

En cas de problème, envoie un mail à $bugMail

-
- Retour -
-
- - - -
- - diff --git a/intranet/modules/mesSous/templates/MonComptePaypalReturn.tmpl b/intranet/modules/mesSous/templates/MonComptePaypalReturn.tmpl deleted file mode 100644 index de47b8ba..00000000 --- a/intranet/modules/mesSous/templates/MonComptePaypalReturn.tmpl +++ /dev/null @@ -1,21 +0,0 @@ -#import cherrypy -#set bugMail = cherrypy.config.get("mail.bugreport", "nounous@crans.org") - - -#include "inc-paypal-head.tmpl" - - -
-

Paiement terminé

-

Ton compte impressions sera crédité dans quelques minutes.

-

N'hésite pas à nous envoyer tes remarques et/ou suggestions à $bugMail

-
- Retour -
-
- - - -
- - diff --git a/intranet/modules/mesSous/templates/MonCompteRechargePaypal1.tmpl b/intranet/modules/mesSous/templates/MonCompteRechargePaypal1.tmpl deleted file mode 100755 index 3e722c24..00000000 --- a/intranet/modules/mesSous/templates/MonCompteRechargePaypal1.tmpl +++ /dev/null @@ -1,21 +0,0 @@ - - -#include "inc-paypal-head.tmpl" - - -
-

Recharger son compte impression

-

Le cr@ns te permet de recharger ton compte pour les impressions via PayPal ou en allant voir un câbleur.

-

La méthode PayPal est plus rapide mais PayPal facture des frais de transaction.

-

N.B. : le solde d'impression est de nouveau crédité directement après le paiement, le bug a été résolu.

- -
- - - - - - diff --git a/intranet/modules/mesSous/templates/MonCompteRechargePaypal2.tmpl b/intranet/modules/mesSous/templates/MonCompteRechargePaypal2.tmpl deleted file mode 100755 index e8a4e9ff..00000000 --- a/intranet/modules/mesSous/templates/MonCompteRechargePaypal2.tmpl +++ /dev/null @@ -1,33 +0,0 @@ - - -#include "inc-paypal-head.tmpl" - - -
-

Étape 1 : Choisir le montant

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

-
- Annuler - - -
- - -
-
- - diff --git a/intranet/modules/mesSous/templates/MonCompteRechargePaypal3.tmpl b/intranet/modules/mesSous/templates/MonCompteRechargePaypal3.tmpl deleted file mode 100755 index 3ce6045b..00000000 --- a/intranet/modules/mesSous/templates/MonCompteRechargePaypal3.tmpl +++ /dev/null @@ -1,35 +0,0 @@ - - -#include "inc-paypal-head.tmpl" - -
-

Étape 2 : Confirmer la facture

- - - - - - - - #for unDetail in $details - - - - - - - #end for - - - -
DescriptionPrix unitaireQuantitétotal
$unDetail.intitule$unDetail.prixUnitaire €$unDetail.quantite$unDetail.prixTotal €
- Total - $total €
- -
- - \ No newline at end of file diff --git a/intranet/modules/mesSous/templates/MonCompteRechargePaypal4.tmpl b/intranet/modules/mesSous/templates/MonCompteRechargePaypal4.tmpl deleted file mode 100755 index 88250136..00000000 --- a/intranet/modules/mesSous/templates/MonCompteRechargePaypal4.tmpl +++ /dev/null @@ -1,17 +0,0 @@ - - -#include "inc-paypal-head.tmpl" - -
-

Étape 3 : Fin

-

Ton compte impressions sera credité dés que la facture -sera reglée.

-

Tu peux régler la facture plus tard en allant dans Mon Soldes

- -
- - diff --git a/intranet/modules/mesSous/templates/factures-historique.tmpl b/intranet/modules/mesSous/templates/factures-historique.tmpl deleted file mode 100755 index 7c772622..00000000 --- a/intranet/modules/mesSous/templates/factures-historique.tmpl +++ /dev/null @@ -1,58 +0,0 @@ -
- -
- - -
-
-

Historique

-
-
- #if $prevPage - << moins vieux - #else - << moins vieux - #end if -  |  - #if $nextPage - plus vieux >> - #else - plus vieux >> - #end if -
- - - - - - - - #for anItem in $historic_items - - - - #if $anItem.type=="debit" - - #else - - #end if - #if $anItem.type=="credit" - - #else - - #end if - - #end for - #if $historic_items == [] - - #end if -
DateIntituléDébitCrédit
$anItem.date$anItem.intitule$anItem.montant $anItem.montant 
- AUCUNE TRANSACTION ENREGISTRÉE -
-
-
-
-
diff --git a/intranet/modules/mesSous/templates/factures.tmpl b/intranet/modules/mesSous/templates/factures.tmpl deleted file mode 100755 index 0f3d5f19..00000000 --- a/intranet/modules/mesSous/templates/factures.tmpl +++ /dev/null @@ -1,115 +0,0 @@ -
- -#if $message != '' - -#end if - -#if $error != '' - -#end if - - - - -
- - -
-
-

Solde

-
$getVar('solde', "n/a") € - Rechargez avec PayPal -
-
- -
-

Mes factures PayPal

- #for f in $listeFactures - #if $f.payee -
- #else -
- #end if -
- - #if $f.details.__len__() > 1 - - #end if - $f.intitule - #if not $f.payee - (non payée) - #end if - - - - $f.montant € - - Crée le - - #if not $f.payee - - Annuler - Payer avec PayPal - - #else - Payée - #end if - -
- #if $f.details.__len__() > 1 - -
- #end if - #end for - - #if $listeFactures == [] -
- AUCUNE TRANSACTION PAYPAL ENREGISTRÉE -
- #end if -
-
-
diff --git a/intranet/modules/mesSous/templates/inc-paypal-head.tmpl b/intranet/modules/mesSous/templates/inc-paypal-head.tmpl deleted file mode 100644 index 907ec0c7..00000000 --- a/intranet/modules/mesSous/templates/inc-paypal-head.tmpl +++ /dev/null @@ -1,11 +0,0 @@ - - - Cr@nsIntranet - - - - - - - - diff --git a/intranet/modules/monCompte/main.py b/intranet/modules/monCompte/main.py deleted file mode 100644 index a3e42a6a..00000000 --- a/intranet/modules/monCompte/main.py +++ /dev/null @@ -1,360 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- -# ##################################################################################################### # -# MonCompte -# ##################################################################################################### # -# Description: -# -# Informations: -# -# Pages: -# -# -# ##################################################################################################### # - -import cherrypy, sys, os, datetime -# libraries crans -import crans.cp as _crans_cp -sys.path.append('/usr/scripts/gestion/') -from config_mail import MailConfig - -if (cherrypy.config.configMap["global"]["server.environment"] == "development"): - from ldap_crans_test import * -# print("monCompte : unsing test ldap : env=" + cherrypy.config.configMap["global"]["server.environment"]) -else: - from ldap_crans import * -# print("monCompte : unsing prod ldap : env=" + cherrypy.config.configMap["global"]["server.environment"]) - -from ClassesIntranet.ModuleBase import ModuleBase - -class main(ModuleBase): - _droits=["personnel"] - def title(self): - return "Mon Compte" - - def getCurrentAdministrativeYear(self): - ''' - premiere partie de l''annee scolaire en cours - ex : le 5 juin 2006 retourne 2005 - ''' - now = datetime.datetime.now() - currentYear = int(now.strftime("%Y")) - currentMonth = int(now.strftime("%m")) - if currentMonth > 8: - administrativeYear = currentYear - else: - administrativeYear = currentYear - 1 - return administrativeYear - - ########################## - # affichage - ########################## - # - # methode qui affiche la template avec toutes les infos de - # l'adherent + les formulaires - # - def index(self, message = '', error = '', currentTab = 'mainTab'): - adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0] - t = {} - t['message'] = message - t['error'] = error - - - ############## info adherent ############## - adherent = {} - # nom, prenom, chambre, tel, solde, droits, mail - adherent['prenom'] = adh.prenom() - adherent['nom'] = adh.nom() - adherent['chambre'] = adh.chbre() - if adherent['chambre'] == "EXT": - adr = adh.adresse() - adherent['adresse'] = {} - adherent['adresse']['ligne1'] = adr[0] - adherent['adresse']['ligne2'] = adr[1] - adherent['adresse']['cp'] = adr[2] - adherent['adresse']['ville'] = adr[3] - adherent['telephone'] = adh.tel - adherent['solde'] = adh.solde - adherent['droits'] = u", ".join(adh.droits()) - adherent['mail'] = adh.email() - # cotisation - administrativeYear = self.getCurrentAdministrativeYear() - if administrativeYear in adh.paiement(): - adherent['cotisationOK'] = 'OK' - else: - adherent['cotisationOK'] = None - # carte etudiant - if administrativeYear in adh.carteEtudiant(): - adherent['carteOK'] = 'OK' - else: - adherent['carteOK'] = None - # annee scolaire (ex 2001-2002) - adherent['anneeScolaire'] = str(administrativeYear) + '-' + str(administrativeYear + 1) - t['adherent'] = adherent - - ############## info mail ############## - mailInfos = {} - try: - mailConfig = MailConfig(cherrypy.session['uid']) - mailInfos['forwarding_address'] = mailConfig['forward'] - mailInfos['spam'] = {} - mailInfos['spam']['no'] = mailConfig['spam'] == 'accepte' - mailInfos['spam']['mark'] = mailConfig['spam'] == 'marque' - mailInfos['spam']['drop'] = mailConfig['spam'] == 'supprime' - except Exception, e: - t['mailError'] = u"Erreur:fichiers de configuration mail personnels" - - mailInfos['alias'] = adh.alias() - mailInfos['contourneGreylist'] = adh.contourneGreylist() - mailInfos['rewriteMailHeaders'] = adh.rewriteMailHeaders() - t['mailInfos'] = mailInfos - - - - return { - 'template' :'monCompte', - 'values' :t, - 'stylesheets' :['monCompte.css'], - 'scripts':['crans_domtab.js','moncompte.js','passwordGenerator.js'], - } - index.exposed = True - - - - ########################## - # paypal - ########################## - # - # methode qui affiche successivement les - # templates du popup pour recharger son compte impression - # via paypal - # - def rechargerCompteImpression(self, etape = '1', combien = None): - adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0] - if (etape == "1"): # Introduction - return { - 'template' :'MonCompteRechargePaypal1', - 'standalone' :True, - 'values' :{}, - } - elif (etape == "2"): # choix montant - return { - 'template' :'MonCompteRechargePaypal2', - 'standalone' :True, - 'values' :{}, - } - elif (etape == "3"): # confirmer facture - # creer objet facture - f = Facture(adh) - # /!\ verifier que combien est un nombre - # et qu'il n'y a pas plus de 2 chiffres après le point... - # (ce serait bien aussi si on pouvait mettre une virgue a la place du point) - try: - # remplacage des virgules - combien = combien.replace(u',', u'.') - # convertissage - combien = float(combien) - # arrondissage-tronquage : - combien = float(int(combien*100)/100.0) - # nombre positif - if combien < 0: - raise ValueError - except Exception: - return { - 'template' :'MonCompteRechargePaypal2', - 'standalone' :True, - 'values' :{'error':"Le montant doit être un nombre positif !", 'combien':combien}, - } - f.ajoute({'nombre': 1, 'code': 'SOLDE', 'designation': 'Credit du compte impression (intranet)', 'pu': combien}) - cherrypy.session['freshFacture'] = f - pageData = {} - pageData['details'] = [ - { - 'intitule':art['designation'], - 'quantite':art['nombre'], - 'prixUnitaire':art['pu'], - 'prixTotal':art['pu']*art['nombre'], - } for art in f.articles()] - pageData['total'] = f.total() - return { - 'template' :'MonCompteRechargePaypal3', - 'standalone' :True, - 'values' :pageData, - } - elif (etape == "4"):# payer maintenant ? - # sauver objet facture - f = cherrypy.session['freshFacture'] - f.save() - return { - 'template' :'MonCompteRechargePaypal4', - 'standalone' :True, - 'values' :{'lienPaypal' : f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False), - businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"), - return_page = "https://intranet.crans.org/monCompte/paypalReturn", - cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel", - )}, - } - rechargerCompteImpression.exposed = True - - def paypalReturn(self, **kw): - _crans_cp.log("retour de paypal avec les infos : %s" % " ".join( [ "[%s: %s]" % (str(a), str(kw[a])) for a in kw] ) ) - return { - 'template' :'MonComptePaypalReturn', - 'standalone' :True, - 'values' :{}, - } - paypalReturn.exposed = True - - def paypalCancel(self, **kw): - _crans_cp.log("annulation de paypal avec les infos : %s" % " ".join( [ "[%s: %s]" % (str(a), str(kw[a])) for a in kw] ) ) - return { - 'template' :'MonComptePaypalCancel', - 'standalone' :True, - 'values' :{}, - } - paypalCancel.exposed = True - - - - ########################################################################### - # methodes pour changer - # des valeurs - ########################################################################### - # - # En fait, les methodes recoivent les valeurs d'un formulaire - # (ou equivalent de javascript), font la modification puis - # appellent la methode principale d'affichage - # en lui passant eventuellement un message a afficher - # (pour indiquer la reussite ou non de l'operation) - # - - ########################## - # Adherent:nom - ########################## - def changeNomAdherent(self, nouveauNom): - adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'], 'w')['adherent'][0] - try: - ancienNom = adh.nom() - adh.nom(nouveauNom) - adh.save() - except ValueError, e: - return self.index(error=e.args[0]) - del adh - _crans_cp.log("Change nom : %s -> %s" % (ancienNom, nouveauNom), "MONCOMPTE") - return self.index(message=u'Modification réussie') - changeNomAdherent.exposed = True - - ########################## - # Adherent:password - ########################## - def changePasswordAdherent(self, ancienPassword, nouveauPassword1, nouveauPassword2): - if ancienPassword=='': - msg = 'Erreur, mot de passe incorrect' - return self.index(error=msg) - if nouveauPassword1=='': - msg = 'Erreur, le nouveau mot de passe ne doit pas ètre vide.' - return self.index(error=msg) - if nouveauPassword1!=nouveauPassword2: - msg = 'Erreur, la confirmation ne correspond pas au nouveau mot de passe.' - return self.index(error=msg) - - adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'],'w')['adherent'][0] - if adh.checkPassword(ancienPassword): - adh.changePasswd(nouveauPassword1) - adh.save() - msg = u'Changement effectué' - else: - msg = 'Erreur, mot de passe incorrect' - return self.index(error=msg) - del adh - _crans_cp.log("Change password", "MONCOMPTE") - return self.index(message=msg) - changePasswordAdherent.exposed = True - - - ########################## - # Adherent:prenom - ########################## - def changePrenomAdherent(self, nouveauPrenom): - adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'], 'w')['adherent'][0] - try: - ancienPrenom = adh.prenom() - adh.prenom(nouveauPrenom) - adh.save() - except ValueError, e: - return self.index(error=e.args[0]) - del adh - _crans_cp.log("Change prenom : %s -> %s" % (ancienPrenom, nouveauPrenom), "MONCOMPTE") - return self.index(message=u'Modification réussie') - changePrenomAdherent.exposed = True - - ########################## - # Adherent:tel - ########################## - def changeTelAdherent(self, nouveauTel): - adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'], 'w')['adherent'][0] - try: - ancienTel = adh.tel() - adh.tel(nouveauTel) - adh.save() - except ValueError, e: - return self.index(error=e.args[0]) - del adh - _crans_cp.log("Change tel : %s -> %s" % (ancienTel, nouveauTel), "MONCOMPTE") - return self.index(message=u'Modification réussie') - changeTelAdherent.exposed = True - - ########################## - # mail:alias:creation - ########################## - def newAlias(self, alias): - adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'],'w')['adherent'][0] - if adh.alias().__len__() >= 20 and adh.droits() == []: - return self.index(error=u"Vous avez déjà 20 alias mail. Demander à un câbleur pour en rajouter et/ou effacer les inutilisés.") - try: - adh.alias(alias) - adh.save() - del adh - except ValueError, e: - return self.index(error=e.args[0]) - except RuntimeError: - return self.index(error=u"Vous possèdez déjà  cet alias") - except EnvironmentError: - return self.index(error=u"Vous possèdez déjà  cet alias") - _crans_cp.log("Nouvel alias : %s" % alias, "MONCOMPTE") - return self.index(message=u'Alias enregistré') - newAlias.exposed = True - - - ########################## - # mail:sauver - ########################## - def saveMailPrefs(self, forwarding_address=None, spanTreatment=None, contourneGreylist=False, rewriteMailHeaders=False): - if spanTreatment == 'no': - spanTreatment = 'accepte' - if spanTreatment == 'mark': - spanTreatment = 'marque' - if spanTreatment == 'drop': - spanTreatment = 'supprime' - - if contourneGreylist == 'oui': - contourneGreylist = True - if rewriteMailHeaders == 'oui': - rewriteMailHeaders = True - - try: - adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'],'w')['adherent'][0] - if forwarding_address!=None: - MailConfig(cherrypy.session['uid'], forward=forwarding_address, spam=spanTreatment) - adh.contourneGreylist(contourneGreylist) - adh.rewriteMailHeaders(rewriteMailHeaders) - adh.save() - del adh - except ValueError, e: - return self.index(error=e.args[0]) - except Exception, e: - return self.index(error=u"Une erreur est survenue lors de lenregistrement. Vérifiez que l'adresse mail fournie est correcte.") - _crans_cp.log("Change mail prefs", "MONCOMPTE ACTION") - return self.index(message=u'Vos préférences ont été enregistrées') - saveMailPrefs.exposed = True - diff --git a/intranet/modules/monCompte/static/crans_domtab.js b/intranet/modules/monCompte/static/crans_domtab.js deleted file mode 100755 index ce6a1fce..00000000 --- a/intranet/modules/monCompte/static/crans_domtab.js +++ /dev/null @@ -1,259 +0,0 @@ -/* - DOMtab Version 3.1415927 - Updated March the First 2006 - written by Christian Heilmann - check blog for updates: http://www.wait-till-i.com - free to use, not free to resell -*/ - -domtab={ - tabClass:'domtab', // class to trigger tabbing - listClass:'domtabs', // class of the menus - activeClass:'active', // class of current link - contentElements:'div', // elements to loop through - backToLinks:/#top/, // pattern to check "back to top" links - printID:'domtabprintview', // id of the print all link - showAllLinkText:'show all content', // text for the print all link - prevNextIndicator:'doprevnext', // class to trigger prev and next links - prevNextClass:'prevnext', // class of the prev and next list - prevLabel:'previous', // HTML content of the prev link - nextLabel:'next', // HTML content of the next link - prevClass:'prev', // class for the prev link - nextClass:'next', // class for the next link - init:function(){ - var temp; - if(!document.getElementById || !document.createTextNode){return;} - var tempelm=document.getElementsByTagName('div'); - for(var i=0;i'); -document.write('div.domtab>div{display:none;}<'); -document.write('/s'+'tyle>'); diff --git a/intranet/modules/monCompte/static/icon.png b/intranet/modules/monCompte/static/icon.png deleted file mode 100755 index f2551b9f..00000000 Binary files a/intranet/modules/monCompte/static/icon.png and /dev/null differ diff --git a/intranet/modules/monCompte/static/monCompte.css b/intranet/modules/monCompte/static/monCompte.css deleted file mode 100755 index 28d9ba70..00000000 --- a/intranet/modules/monCompte/static/monCompte.css +++ /dev/null @@ -1,368 +0,0 @@ -/******************************************** - * -********************************************/ -#globalDiv { - padding-left:100px; -} - -/* style du titre au dessus des onglet et des titres pour les pages PayPal */ -div.domtab>h1, -h2 { - font-size:1.4em; - margin:2px; -} - - -/******************************************** - * -********************************************/ -/* conteneur de l'ensemble */ -div.domtab{ - padding:3px; - width:100%; - background:#fad163; - clear:left; -} - -/* onglets */ -ul.domtabs{ - float:left; - width:100%; - margin:0; - padding:0; - list-style-type:none; - -} -ul.domtabs li{ - float:left; -} -ul.domtabs a:link, -ul.domtabs a:visited, -ul.domtabs a:active, -ul.domtabs a:hover{ - font-weight:bold; - display:block; - padding:0.4em; - text-align:center; - background:#fad163; -} - -ul.domtabs li.active a:link, -ul.domtabs li.active a:visited, -ul.domtabs li.active a:active, -ul.domtabs li.active a:hover{ - background:#fff7D7; - color:#000; - text-decoration:none; -} - -/* les pages */ -div.domtab>div { - padding:0; - clear:both; - border:5px solid #fff7D7; -} -/* ancre des pages */ -.mark { - height:0; - clear:both; - display:none; -} - -/******************************************** - * -********************************************/ -.tabbed_page { - padding:0; - margin:0; -} - -ul.tabbed_page { - list-style-type:none; -} - -dl.tabbed_page>dt, -dl.tabbed_page>dd, -ul.tabbed_page>li { - background:#fff7D7; - padding:10px; - margin:0 0 2px 0; - font-weight:bold; -} -dl.tabbed_page>dt.last, -dl.tabbed_page>dd.last, -ul.tabbed_page>li.last { - margin:0 0 0 0; -} - -dl.tabbed_page>dt { - width:40%; - display:block; - height:100%; - float:left; - clear:left; -} - -dl.tabbed_page>dd { - padding-left:45%; -} - -span.actions { - display:block; - float:right; - font-size:0.9em; - font-weight:normal; -} -.tabbed_page span.actions a { - margin:2px 10px; -} - - -.tabbed_page dl, -.tabbed_page dl dt, -.tabbed_page dl dd { - margin:0; - padding:0; -} - -.tabbed_page dl dt { - float:left; - margin-right:5px; -} - -.tabbed_page dl dd, -.tabbed_page p { - font-weight:normal; - margin:3px; -} - - -span.valide { - color:green; - font-weight:bold; -} - -span.invalide { - color:red; - font-weight:bold; -} - -.clear { - clear:both; -} - -ul.tabbed_page li.centrer { - padding:10px; - margin-left:0; - text-align:center; -} - - -/******************************************** - * -********************************************/ - -.textInputNote { - display:block; - padding-left:0; - font-size:0.8em; - font-weight:normal; -} - -dd .textInputNote { - padding-left:0; -} -li .textInputNote { - padding-left:175px; -} - -label.textInputLabel{ - width:175px; - display:block; - float:left; -} - -label.checkBoxLabel{ - float:none; - padding-left:175px; -} - -/******************************************** - * -********************************************/ -dl#machineList, -dl#machineList>dt { - margin:0; - padding:0; -} -#machineList>dt { - - font-size:1.2em; - font-weight:bold; - margin:5px 5px 5px 5px; - height:30px; - padding:10px 20px; - background:#fff7D7; -} -#machineList>dd { - margin:0 0 2px 0; -} -.linkToggle { - display:block; - float:left; - height:15px; - width:15px; - background:transparent url(../images/fl.png) top left; - margin-right:1px; -} -/******************************************** - * -********************************************/ -.machineDetails { - background: #fff7D7;/*/ url(../images/fondFacturesDetails.png) repeat-x top;*/ - padding:0; - /*width:96%;*/ - display:none; - margin:0; -} - -dl.machineInfos dt, dl.machineInfos dd { - float:left; - margin-top:0; - padding:.1em; - display:block; - width:20%; -} - -dl.machineInfos dt { - text-align:right; - width:20%; - -} -/******************************************** - * -********************************************/ -ul.listeAlias { - list-style-type:none; - margin:0; - padding:0; -} -ul.listeAlias li span { - color:#666; -} - - -/******************************************** - * -********************************************/ -#loadings { - background:#cc0000; - position:fixed; - top:1px; - right:1px; - z-index:1000; - display:none; - padding:2px 3px; - color:white; -} - -.messageText { - padding:2px 10px; - display:block; -} -#messagePlaceHolder { - height:0; - overflow:visible; - position:relative; - top:-4em; -} - -.message { - padding:0; - background:#fad163; - width:300px; - text-align:center; - margin : 1px auto 10px auto; -} -.errorMessage { - display:block; - background:white; - border:2px #cc0000 solid; - padding:5px; - text-align:center; - min-width:230px; - max-width:430px; - font-weight:bold; - margin : 1px auto 10px auto; -} - -/******************************************** - * -********************************************/ -div#popupInnerBody { - border:5px solid #fad163; - background: #fff7D7; - margin:5px; - padding:5px; -} - -div#popupInnerBody .liens { - list-style-type:none; - float:right; - height:1em; - background: #fff7D7; - border-color:#fad163; - border-style: none solid solid solid; - border-width:3px; - margin:0; - padding:2px; -} - -div#popupInnerBody .liens a { - display:block; - height:1em; - float : left; - margin:0 5px; -} - -a { color:blue; } - -/******************************************** - * -********************************************/ - -table.factureDetails { - padding:1%; - width:96%; - margin:0 1% 10px 1%; -} - - -.tdTotalDetail, -.tdTotalDetailIntitule { - border-top:thin black solid; -} - -.tdTotalDetailIntitule { - text-align:right; - font-weight:bold; -} - -table.factureDetails th { - border-bottom:thin black solid; -} -table.factureDetails th, -table.factureDetails td { - border-right:thin black solid; - margin:0; - padding:5px 20px; -} - - - -/******************************************** - * divers -********************************************/ -.empty { - color:gray; -} diff --git a/intranet/modules/monCompte/static/moncompte.js b/intranet/modules/monCompte/static/moncompte.js deleted file mode 100755 index 3abaac7e..00000000 --- a/intranet/modules/monCompte/static/moncompte.js +++ /dev/null @@ -1,41 +0,0 @@ -function askForName(oldName) { - var c = ''; - while ( c == '') - c = prompt("Votre nom :",oldName); - if (c == null) - return false; - else - window.location.href= 'changeNomAdherent?nouveauNom=' + c; -} - - -function askForSurname(oldSurname) { - var c = ''; - while ( c == '') - c = prompt("Votre prénom :",oldSurname); - if (c == null) - return false; - else - window.location.href= 'changePrenomAdherent?nouveauPrenom=' + c; -} - -function askForTel(oldTel) { - var c = ''; - while ( c == '') - c = prompt("Votre numéro de téléphone :",oldTel); - if (c == null) - return false; - else - window.location.href= 'changeTelAdherent?nouveauTel=' + c; -} - - -function newAlias() { - var c = ''; - while ( c == '') - c = prompt("Nouvel alias :"); - if (c == null) - return false; - else - window.location.href= 'newAlias?alias=' + c + "#mailTab"; -} diff --git a/intranet/modules/monCompte/static/passwordGenerator.js b/intranet/modules/monCompte/static/passwordGenerator.js deleted file mode 100755 index 18b6cf90..00000000 --- a/intranet/modules/monCompte/static/passwordGenerator.js +++ /dev/null @@ -1,66 +0,0 @@ -/************************************************************************ - Password generator - ************************************************************************/ - -function GeneratePassword() { - - if (parseInt(navigator.appVersion) <= 3) { - alert("Sorry this only works in 4.0 browsers"); - return false; - } - - var length=8; - var sPassword = ""; - length = 10;//document.aForm.charLen.options[document.aForm.charLen.selectedIndex].value; - - var noPunction = false;//(document.aForm.punc.checked); - var randomLength = true;//(document.aForm.rLen.checked); - - if (randomLength) { - length = Math.random(); - - length = parseInt(length * 100); - length = (length % 7) + 6 - } - - - for (i=0; i < length; i++) { - - numI = getRandomNum(); - if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } } - - sPassword = sPassword + String.fromCharCode(numI); - } - - //document.aForm.passField.value = sPassword - c = prompt('Mot de passe généré : ', sPassword) - if (c!= null) { - document.changePasswordForm.nouveauPassword1.value = c - document.changePasswordForm.nouveauPassword2.value = c - } - return false; -} - -function getRandomNum() { - - // between 0 - 1 - var rndNum = Math.random() - - // rndNum from 0 - 1000 - rndNum = parseInt(rndNum * 1000); - - // rndNum from 33 - 127 - rndNum = (rndNum % 94) + 33; - - return rndNum; -} - -function checkPunc(num) { - - if ((num >=33) && (num <=47)) { return true; } - if ((num >=58) && (num <=64)) { return true; } - if ((num >=91) && (num <=96)) { return true; } - if ((num >=123) && (num <=126)) { return true; } - - return false; -} diff --git a/intranet/modules/monCompte/templates/MonComptePaypalCancel.tmpl b/intranet/modules/monCompte/templates/MonComptePaypalCancel.tmpl deleted file mode 100644 index 7bef45d6..00000000 --- a/intranet/modules/monCompte/templates/MonComptePaypalCancel.tmpl +++ /dev/null @@ -1,22 +0,0 @@ -#import cherrypy -#set bugMail = cherrypy.config.get("mail.bugreport", "nounous@crans.org") - - -#include "inc-paypal-head.tmpl" - - -
-

Paiement annulé

-

Ton compte impressions sera crédité dés que la facture sera réglée.

-

Tu peux régler la facture plus tard en allant dans Mes Factures

-

En cas de problème, envoie un mail à $bugMail

-
- Retour -
-
- - - -
- - diff --git a/intranet/modules/monCompte/templates/MonComptePaypalReturn.tmpl b/intranet/modules/monCompte/templates/MonComptePaypalReturn.tmpl deleted file mode 100644 index e96cd6c3..00000000 --- a/intranet/modules/monCompte/templates/MonComptePaypalReturn.tmpl +++ /dev/null @@ -1,21 +0,0 @@ -#import cherrypy -#set bugMail = cherrypy.config.get("mail.bugreport", "nounous@crans.org") - - -#include "inc-paypal-head.tmpl" - - -
-

Paiement terminé

-

Ton compte impressions sera crédité dans quelques minutes.

-

N'hésite pas à nous envoyer tes remarques et/ou suggestions à $bugMail

-
- Retour -
-
- - - - - - diff --git a/intranet/modules/monCompte/templates/MonCompteRechargePaypal1.tmpl b/intranet/modules/monCompte/templates/MonCompteRechargePaypal1.tmpl deleted file mode 100755 index f8e76575..00000000 --- a/intranet/modules/monCompte/templates/MonCompteRechargePaypal1.tmpl +++ /dev/null @@ -1,20 +0,0 @@ - - -#include "inc-paypal-head.tmpl" - - -
-

Recharger son compte impression

-

Le cr@ns te permet de recharger ton compte pour les impressions via PayPal ou en allant voir un câbleur.

-

La méthode PayPal est plus rapide mais PayPal facture des frais de transaction.

- -
- - - - - - \ No newline at end of file diff --git a/intranet/modules/monCompte/templates/MonCompteRechargePaypal2.tmpl b/intranet/modules/monCompte/templates/MonCompteRechargePaypal2.tmpl deleted file mode 100755 index e8a4e9ff..00000000 --- a/intranet/modules/monCompte/templates/MonCompteRechargePaypal2.tmpl +++ /dev/null @@ -1,33 +0,0 @@ - - -#include "inc-paypal-head.tmpl" - - -
-

Étape 1 : Choisir le montant

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

-
- Annuler - - -
- - -
-
- - diff --git a/intranet/modules/monCompte/templates/MonCompteRechargePaypal3.tmpl b/intranet/modules/monCompte/templates/MonCompteRechargePaypal3.tmpl deleted file mode 100755 index 3ce6045b..00000000 --- a/intranet/modules/monCompte/templates/MonCompteRechargePaypal3.tmpl +++ /dev/null @@ -1,35 +0,0 @@ - - -#include "inc-paypal-head.tmpl" - -
-

Étape 2 : Confirmer la facture

- - - - - - - - #for unDetail in $details - - - - - - - #end for - - - -
DescriptionPrix unitaireQuantitétotal
$unDetail.intitule$unDetail.prixUnitaire €$unDetail.quantite$unDetail.prixTotal €
- Total - $total €
- -
- - \ No newline at end of file diff --git a/intranet/modules/monCompte/templates/MonCompteRechargePaypal4.tmpl b/intranet/modules/monCompte/templates/MonCompteRechargePaypal4.tmpl deleted file mode 100755 index c9c52d59..00000000 --- a/intranet/modules/monCompte/templates/MonCompteRechargePaypal4.tmpl +++ /dev/null @@ -1,15 +0,0 @@ - - -#include "inc-paypal-head.tmpl" - -
-

Étape 3 : Fin

-

Ton compte impressions sera crédité dés que la facture sera réglée.

-

Tu peux régler la facture plus tard en allant dans Mes Factures

- -
- - \ No newline at end of file diff --git a/intranet/modules/monCompte/templates/inc-paypal-head.tmpl b/intranet/modules/monCompte/templates/inc-paypal-head.tmpl deleted file mode 100644 index 907ec0c7..00000000 --- a/intranet/modules/monCompte/templates/inc-paypal-head.tmpl +++ /dev/null @@ -1,11 +0,0 @@ - - - Cr@nsIntranet - - - - - - - - diff --git a/intranet/modules/monCompte/templates/monCompte.tmpl b/intranet/modules/monCompte/templates/monCompte.tmpl deleted file mode 100755 index 63122351..00000000 --- a/intranet/modules/monCompte/templates/monCompte.tmpl +++ /dev/null @@ -1,216 +0,0 @@ -#encoding UTF-8 -#if $getVar('message',False) - -#end if - -#if $getVar('error',False) - -#end if - -
-
-

Paramètres de mon compte

- - -
-

-
-
Nom :
-
$adherent.nom - modifier -
-
-
Prénom :
-
$adherent.prenom - modifier -
-
- #if $getVar('adherent.adresse', False) -
Adresse :
-
- $adherent.adresse.ligne1
- #if $adherent.adresse.ligne2 != u' ' - $adherent.adresse.ligne2
- #end if - $adherent.adresse.cp $adherent.adresse.ville -
- #else -
Chambre :
-
$adherent.chambre
- #end if -
Solde :
-
- $adherent.solde € - modifier - -
-
-
Téléphone :
-
$adherent.telephone - modifier -
-
- #if $adherent.droits -
Droits :
-
- $adherent.droits -
- #end if -
État administratif pour l'année $adherent.anneeScolaire :
-
-
-
Cotisation :
-
- #if $adherent.cotisationOK - OK - #else - Non payée - #end if -
-
Carte d'étudiant :
-
- #if $adherent.carteOK - OK - #else - pas de carte d'étudiant - #end if -
-
-
-
Changer mon mot de passe
-
-
-
- -
- -
- Générer un nouveau mot de passe
- -
- -
-
-
-
-
- -
-

-
-
-
Alias:
-
- #if $mailInfos.alias==[] - Vous n'avez pas d'alias - #else -
    - #for $an_alias in $mailInfos.alias -
  • $an_alias
  • - #end for -
- #end if -
- - Nouvel alias -
- Afin d'éviter les abus, la destruction d'un alias nécessite une - demande via la mailing-list respbats@crans.org. -
-
-
-
Greylisting:
-
- #if $mailInfos.contourneGreylist==True - - #else - - #end if - Plus d'infos
-
-
- Entêtes: -
-
- #if $mailInfos.rewriteMailHeaders==True - - #else - - #end if -
-
-#if $getVar('mailError', False) -
    -
  • - $mailError -
  • -
-#else -
-
Transfert:
-
- -

Laisser vide pour désactiver le transfert


- -
-
Tri des spams:
-
-
-
-
-
-
-#end if -
    -
  • - - -
  • -
-
-
-
-
diff --git a/intranet/static/css/accueil.css b/intranet/static/css/accueil.css deleted file mode 100644 index c0512f91..00000000 --- a/intranet/static/css/accueil.css +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************* - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... -. . .... ............. .. ... -.. .. ... ........ ... ... - ................................ - -============================================================== -mainInterface.css - Intranet Style - - Mise en page de l'accueil - - -Copyright (c) 2006 by www.crans.org - -**************************************************************/ - -div.framed_gray { - border-radius:20px; - -webkit-border-radius:20px; - border-right:3px solid DarkGreen; - border-bottom:3px solid DarkGreen; - background-color: PaleGreen; - padding:10px; -} - -div.framed_gray fieldset { - border-width:2px; - border-style:solid none none none; - border-color: DarkGreen; - padding:10px; - margin:10px 10px; - font-weight:bold; - clear: left; -} - -div.framed_gray fieldset legend { - color: DarkGreen; -} - -div.framed_gray fieldset ul { - list-style-type:none; - margin:0; - padding:0; -} - -div.framed_gray fieldset ul li { - float:left; - height:70px; - width:100px; - margin:5px; - display:block; - text-align:center; -} - -div.framed_gray fieldset ul li span { - margin-bottom:0; - display:block; -} -div.framed_gray fieldset ul a { - color:black; - text-decoration:none; -} - -div.framed_gray fieldset ul li img { - margin:2px auto; - width:32px; - height:32px; -} diff --git a/intranet/static/css/form.css b/intranet/static/css/form.css deleted file mode 100644 index d7a05344..00000000 --- a/intranet/static/css/form.css +++ /dev/null @@ -1,262 +0,0 @@ -/* form.css */ - -form * { - margin: 0px; - padding: 0px; -} - -form { - margin: 0px; - padding: 0px; - font-size: 100%; - min-width: 570px; - max-width: 570px; - width: 570px; -} - -form fieldset { - clear: both; - font-size: 100%; - border-color: #000000; - border-width: 1px 0px 0px 0px; - border-style: solid none none none; - padding: 10px; - margin: 0px 0px 0px 0px; -} - -form fieldset legend { - font-size: 150%; - font-weight: normal; - color: #000000; - margin: 0px 0px 0px 0px; - padding: 0px 5px; -} - -label { - font-size: 100%; -} - -label u { - font-style: normal; - text-decoration: underline; -} - -input, select, textarea { - font-family: Tahoma, Arial, sans-serif; - font-size: 100%; - color: #000000; -} - -textarea { - overflow: auto; -} - -form div { - clear: left; - display: block; - height: expression('1%'); - margin: 5px 0px 0px 0px; - padding: 1px 3px; -} - -form fieldset div.notes { - float: right; - width: 158px; - height: auto; - margin: 0px 0px 10px 10px; - padding: 5px; - border: 1px solid #666666; - background-color: #ffffe1; - color: #666666; - font-size: 88%; -} - -form fieldset div.notes h4 { - background-image: url(img/icon_info.gif); - background-repeat: no-repeat; - background-position: top left; - padding: 3px 0px 3px 27px; - border-width: 0px 0px 1px 0px; - border-style: solid; - border-color: #666666; - color: #666666; - font-size: 110%; -} - -form fieldset div.notes p { - margin: 0em 0em 1.2em 0em; - color: #666666; -} - -form fieldset div.notes p.last { - margin: 0em; -} - -form div fieldset { - clear: none; - border-width: 1px; - border-style: solid; - border-color: #666666; - margin: 0px 0px 0px 142px; - padding: 0px 5px 5px 5px; - width: 197px; -} - -form div fieldset legend { - font-size: 100%; - padding: 0px 3px 0px 9px; -} - -form div.required fieldset legend { - font-weight: bold; -} - -form div label { - display: block; - float: left; - width: 130px; - padding: 3px 5px; - margin: 0px 0px 5px 0px; - text-align: right; -} - -form div.optional label, label.optional { - font-weight: normal; -} - -form div.required label, label.required { - font-weight: bold; -} - -form div label.labelCheckbox, form div label.labelRadio { - float: none; - display: block; - width: 200px; - height: expression('1%'); - padding: 0px; - margin: 0px 0px 5px 142px; - text-align: left; -} - -form div fieldset label.labelCheckbox, form div fieldset label.labelRadio { - margin: 0px 0px 5px 0px; - width: 170px; -} - -form div img { - border: 1px solid #000000; -} - -p.error { - background-color: #ff0000; - background-image: url(/images/icon_error.gif); - background-repeat: no-repeat; - background-position: 3px 3px; - color: #ffffff; - padding: 3px 3px 5px 27px; - border: 1px solid #000000; - margin: auto 100px; -} - -form div.error { - background-color: #ffffe1; - background-image: url(/images/required_bg.gif); - background-repeat: no-repeat; - background-position: top left; - color: #666666; - border: 1px solid #ff0000; -} - -form div.error p.error { - background-image: url(/images/icon_error.gif); - background-position: top left; - background-color: transparent; - border-style: none; - font-size: 88%; - font-weight: bold; - margin: 0px 0px 0px 118px; - width: 200px; - color: #ff0000; -} - -form div input, form div select, form div textarea { - width: 200px; - padding: 1px 3px; - margin: 0px 0px 0px 0px; -} - - - -form div input.inputFile { - width: 211px; -} - -form div select.selectOne, form div select.selectMultiple { - width: 211px; - padding: 1px 3px; -} - -form div input.inputCheckbox, form div input.inputRadio, input.inputCheckbox, input.inputRadio { - display: inline; - height: 14px; - width: 14px; - background-color: transparent; - border-width: 0px; - padding: 0px; - margin: 0px 0px 0px 140px; -} - -form div.submit { - padding: 0px 0px 0px 140px; - text-align:right; -} - -form div.submit div { - display: inline; - float: left; - text-align: left; - width: auto; - padding: 0px; - margin: 0px; -} - -form div input.inputSubmit, form div input.inputButton, input.inputSubmit, input.inputButton { - background-color: #cccccc; - color: #000000; - width: auto; - padding: 0px 6px; - margin: 0px; -} - -form div.submit div input.inputSubmit, form div.submit div input.inputButton { - float: right; - margin: 0px 0px 0px 5px; -} - -form div small { - display: block; - margin: 0px 0px 5px 142px; - padding: 1px 3px; - font-size: 88%; - height: expression('1%'); - width:200px; - -} - -form div.wide input.inputText, form div.wide input.inputPassword, form div.wide input.inputFile, form div.wide select, form div.wide textarea { - width: 344px; - margin: 0px; -} - -form div.notes p, form div small { - line-height: 125%; -} - -form div.wide small { - margin: 0px 0px 5px 0px; -} - -form div.wide label { - float: none; - display: block; -} diff --git a/intranet/static/css/login.css b/intranet/static/css/login.css deleted file mode 100644 index 618775fe..00000000 --- a/intranet/static/css/login.css +++ /dev/null @@ -1,71 +0,0 @@ -.form { - width: 260px; - padding: 0; - margin: 0 auto; - margin-top: 60px; - } - -.title{ - position: relative; - left: -50px; - top: 20px; -} - -h2 { - position: relative; - float: left; - top: 20px; - margin: 0 0 0.5em 0; - padding:0 0 0 0; -} -img { - position: relative; - top: -60px; - float:left; -} -.block { - padding: 20px; - background: LightBlue; - border-right: 2px solid DarkSlateGrey; - border-bottom: 2px solid DarkSlateGrey; - border-radius: 20px; - -webkit-border-radius: 20px; - margin:0 auto; - } -label { - display:block; - float:left; - width:100%; - clear:both; -} -textInputLabel { - display: block; - width:150px; -} -div#message { - background: #faa; - border-right: 1px DarkRed solid; - border-bottom:1px DarkRed solid; - border-radius: 10px; - -webkit-border-radius: 10px; - padding:5px; - text-align:center; - font-weight:bold; - margin:10px auto 10px auto; - clear:both; -} -.liens { - text-align:right; - margin-top: 0.5em; - } -/**/ -#mainFooter { - text-align:center; - color:gray; - font-size:small; -} -#mainFooter a { - color:gray; - margin:5px; -} - diff --git a/intranet/static/css/mainInterface.css b/intranet/static/css/mainInterface.css deleted file mode 100644 index 58929861..00000000 --- a/intranet/static/css/mainInterface.css +++ /dev/null @@ -1,243 +0,0 @@ -/************************************************************* - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... -. . .... ............. .. ... -.. .. ... ........ ... ... - ................................ - -============================================================== -mainInterface.css - Intranet Style - - STYLE GLOBAL ET MISE EN PAGE DES ELEMENTS COMMUNS - - -Copyright (c) 2006 by www.crans.org - -**************************************************************/ - -/* STYLE GLOBAL - - body - - liens - - messages - - aides - - ... -*/ - -body -{ - background:white; - padding:150px 5px 5px 5px; - margin:0; - font-family: arial, "lucida console", sans-serif; - font-size:12px; -} - -a, a:hover, a:visited {color:blue;} - -h1#pageTitle { - border:5px solid #e2e2e2; /* #acc0ff */ - background-color:#f2f2f2; - width:100%; - margin:0; -} - -img { - border:none; -} - - -div#pageContent { - padding:0; - margin:10px; -} - -/**************************************************************************/ -/* LE HAUT DES PAGES - - le logo a gauche - - petit menu a droite -*/ - -div#topContent { - position:absolute; - top:0px; - left:0px; - width:100%; - height:150px; - padding:0; - font-weight:bold; -} - -img#main_topContentLogo { - height:100%; -} -/**/ - -ul#main_topContentMenu { - /* Position */ - z-index:2; - position:absolute; - right:0px; - top:0px; - /* taille */ - height:30px; - float:right; - /* disposition */ - padding:0; - margin:0; - background:transparent; - /* suppression des puces de liste */ - list-style-type: none; -} - -ul#main_topContentMenu li { - float:left; - padding:0 10px; - border-right:1px black solid; -} -ul#main_topContentMenu li.last { - border-right-style:none; -} - -ul#main_topContentMenu hr, div#topMenu h1 { - display:none; -} - -/************************************************************************** - * LE BAS DES PAGES - **************************************************************************/ -/**/ - -#mainFooter { - text-align:center; - color:gray; - font-size:small; -} -#mainFooter a { - color:gray; - margin:5px; -} - - -/************************************************************************** - * Messages - * (les messages affichés sur les pages pour indiquer le bon déroulement - * ou non d'une action) - **************************************************************************/ -#_crans_main_message_place_holder { - height:0; - overflow:visible; - position:absolute; - top:100px; - width:100%; -} - -.messageText { - padding:2px 10px; - display:block; -} - -.message { - padding: 0; - background: #fad163; - width: 300px; - text-align: center; - margin : 1px auto 10px auto; -} -.errorMessage { - display:block; - background:white; - border:2px #cc0000 solid; - padding:5px; - text-align:center; - min-width:230px; - max-width:430px; - font-weight:bold; - margin : 1px auto 10px auto; -} - -#_crans_main_message_chargement { - background:#cc0000; - position:fixed; - top:1px; - right:1px; - z-index:1000; - display:none; - padding:2px 3px; - color:white; -} - -/************************************************************************** - * DIVERS - **************************************************************************/ - - -/**/ -#leftMenu ul { - list-style-type: none; - /* disposition */ - padding:0 25px; -} - -#leftMenu h2 { - display:none; -} - -div.visualClear {clear:both;} - - -.aide { - font-size:0.8em; -} - - -.crans_warning { - font-style: italic; - font-size: .8em; - border : thin black solid; - display: block; - width:80%; - padding:3px 5px 3px 30px; - margin:auto; - background: center left no-repeat url('/static/images/crans_mini_warning.png'); -} -.crans_ajax_error { - display: block; - width:100%; - position: absolute; - top:0; - left:0; - padding:0; - z-index:100; - background: #fff88f; - border-bottom : thin gray solid;} - -.crans_ajax_error>div { - font-weight: bold; - font-size: 1em; - display: block; - padding:1em 1em 1em 25px; - margin-left:1em; - z-index:100; - background: transparent center left no-repeat url('/static/images/crans_mini_warning.png'); -} - -.crans_signature { -text-align: right; -display: block; -} - -a.crans_helpd { - min-height: 15px; - padding-left:17px; - background: no-repeat url('/static/images/crans_help.png'); -} diff --git a/intranet/static/intranet_ferme.html b/intranet/static/intranet_ferme.html deleted file mode 100644 index 39c40955..00000000 --- a/intranet/static/intranet_ferme.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Cr@ns Intranet - - - - - - - - - - - - - -
-
- -
-
- - -
- Fermé pour travaux -
- -

-

Liens Cr@ns

- -
-

L'intranet est en version beta, aidez-nous à - l'améliorer en nous envoyant vos remarques et en nous signalant tout - problème à intranet-bugreport@lists.crans.org

-
-
- - - diff --git a/intranet/static/scripts/AJAX.js b/intranet/static/scripts/AJAX.js deleted file mode 100644 index bfcda8b8..00000000 --- a/intranet/static/scripts/AJAX.js +++ /dev/null @@ -1,32 +0,0 @@ -/***************************** - AJAX - *****************************/ -AJAX = {}; - -AJAX.call = function(page, callBack, loadingMessage) { - var loadingMessage = (loadingMessage == null) ? true : loadingMessage; - //console.debug("calling AJAX : " + page); - if (loadingMessage) { - Crans.loading.display(true); - var oldCallBack = callBack; - callBack = function(r) { - Crans.loading.display(false); - oldCallBack( r ); - }; - } - var e = loadJSONDoc(page); - e.addCallback(callBack); - e.addErrback(AJAX.errorHandler); -} - -AJAX.errorHandler = function(d) { - Crans.loading.display(false); - appendChildNodes(document.body, - DIV({"class":"crans_ajax_error"}, - DIV({}, - "Erreur de communication, essayez de vous ", - A({"href":"do_logout"}, "reconnecter"), ".") - )); - logError("AJAX Error: " + d); - //Impression.AJAX.modifPrix("Erreur...", false); -} diff --git a/intranet/static/scripts/crans.js b/intranet/static/scripts/crans.js deleted file mode 100755 index c5ee3fe2..00000000 --- a/intranet/static/scripts/crans.js +++ /dev/null @@ -1,151 +0,0 @@ -/* ************************************************************ - * Concole - ************************************************************ - * Si firebug est présent, utilisation de la console intégrée - * à la place de celle de MockieKit - */ -try { -/* if (console.firebug) { - log("Using Firebug console"); - log = function(m) {console.log(m)}; - logWarning = function(m){console.warn(m)}; - logInfo = function(m){console.info(m)}; - logDebug = function(m){console.debug(m)}; - logError = function(m){console.error(m)}; - logFatal = function(m){console.error(m)}; - } -*/ -MochiKit.Logging.logger.useNativeConsole = true -} -catch (Exception) {} - - - -/* ************************************************************ - * Crans - ************************************************************ - * Crans.messages : afficher des messages sur les pages - * Crans.loading : afficher l'indicateur de chargement - * Crans.keys : gestion des touches du clavier - */ -Crans = {}; - -/***************************** - Crans.Messages - *****************************/ -Crans.messages = {} -Crans.messages.initialized = false; - -Crans.messages.init = function() -{ - if (!Crans.messages.initialized) - { - //updateNodeAttributes(document.body, {'onclick':'Crans.messages.setMessage();'}); - appendChildNodes(document.body, DIV({'id':'_crans_main_message_place_holder'})); - Crans.messages.initialized = true; - logDebug("Crans.message initialized"); - } -} - - -Crans.messages.setMessage = function(m, messageClass) -{ - if (!Crans.messages.initialized) - Crans.messages.init(); - if (m == null) { - var messageBox = ''; - } else { - if (messageClass==null) - messageClass='message'; - if (messageClass == "errorMessage") - logWarning(m); - else - log(m); - var textHolder = SPAN({'class':'messageText'},m); - var messageBox = DIV({'class':messageClass},textHolder); - var messagePlace = document.getElementById("_crans_main_message_place_holder"); - } - try { - var messagePlace = document.getElementById("_crans_main_message_place_holder"); - replaceChildNodes(messagePlace,messageBox); - try {roundElement(messageBox);} catch (error) {} - } - catch (error) { - logError("élement _crans_main_message_place_holder introuvable") - return - } -} - -/***************************** - Crans.loading - *****************************/ -Crans.loading = {} -Crans.loading.initialized = false; - -Crans.loading.init = function(){ - try { - if (!Crans.loading.initialized) { - appendChildNodes(document.body, DIV({'id':'_crans_main_message_chargement'}, "Chargement...")); - Crans.loading.initialized = true; - } - } catch (error) { - logError(error.description); - } -} - -Crans.loading.display = function(bool) { - if (!Crans.loading.initialized) - Crans.loading.init(); - var loadingEl = document.getElementById("_crans_main_message_chargement"); - if (loadingEl) { - if (bool) { - appear(loadingEl); - } else { - fade(loadingEl, {duration:0.1}); - } - } else { - logFatal("Crans.loading cannot fid _crans_main_message_chargement element"); } - return false; -} - -/***************************** - Crans.keys - *****************************/ -Crans.keys = {} -Crans.keys.handled = false; - - -Crans.keys.handleF1 = function() -{ - createLoggingPane(true); -}; - -Crans.keys.keyMap = -{ - 'KEY_F1': Crans.keys.handleF1 -// , 'KEY_ESCAPE':alert -}; - - -connect(document, 'onkeydown', - function(e) - { - // We're storing a handled flag to work around a Safari bug: - if (true)//(!Crans.keys.handled) - { - - var key = e.key(); - var fn = Crans.keys.keyMap[key.string]; - if (fn) - { - fn(); - } - - //replaceChildNodes('onkeydown_code', key.code); - //replaceChildNodes('onkeydown_string', key.string); - //KeyEvents.updateModifiers(e); - } - - Crans.keys.handled = true; - } - ); \ No newline at end of file diff --git a/intranet/static/scripts/crans_domtab.js b/intranet/static/scripts/crans_domtab.js deleted file mode 100755 index ce6a1fce..00000000 --- a/intranet/static/scripts/crans_domtab.js +++ /dev/null @@ -1,259 +0,0 @@ -/* - DOMtab Version 3.1415927 - Updated March the First 2006 - written by Christian Heilmann - check blog for updates: http://www.wait-till-i.com - free to use, not free to resell -*/ - -domtab={ - tabClass:'domtab', // class to trigger tabbing - listClass:'domtabs', // class of the menus - activeClass:'active', // class of current link - contentElements:'div', // elements to loop through - backToLinks:/#top/, // pattern to check "back to top" links - printID:'domtabprintview', // id of the print all link - showAllLinkText:'show all content', // text for the print all link - prevNextIndicator:'doprevnext', // class to trigger prev and next links - prevNextClass:'prevnext', // class of the prev and next list - prevLabel:'previous', // HTML content of the prev link - nextLabel:'next', // HTML content of the next link - prevClass:'prev', // class for the prev link - nextClass:'next', // class for the next link - init:function(){ - var temp; - if(!document.getElementById || !document.createTextNode){return;} - var tempelm=document.getElementsByTagName('div'); - for(var i=0;i'); -document.write('div.domtab>div{display:none;}<'); -document.write('/s'+'tyle>'); diff --git a/intranet/static/scripts/popup.js b/intranet/static/scripts/popup.js deleted file mode 100644 index be13efbb..00000000 --- a/intranet/static/scripts/popup.js +++ /dev/null @@ -1,35 +0,0 @@ -Popup = {}; -Popup.popupNode = null; -Popup.visible = false; - -Popup.display = function() -{ - if (this.popupNode == null) { - logError("Popup not created, cannot be displayed"); - return false; - } - appendChildNodes("pageContent", this.popupNode); - this.visible = true; - // logDebug("popup visible"); -} - -Popup.create = function(options, title_popup, content) { - var inPopup = DIV({"id":"__popupInDivId", "style":"background:white;margin:2px 5px;"}, content); - var outPopup = DIV({"id":"__popupOutDivId","style":"background:#AE0F3E;z-index:500;float:left;padding:0;min-width:300px;position:fixed;top:30%;left:30%;right:30%;"}, H1({"style":"font-size:1em;margin:0;text-align:center;color:white;"}, IMG({"src":"/static/images/WindowTitleLogo.png","alt":"icon", "style":"margin:0 5px;"}), title_popup), inPopup ); - roundElement(outPopup); - logDebug("Popup \""+ title_popup +"\" created"); - this.popupNode = outPopup; -} - -Popup.hide = function() { - if (this.visible) { - removeElement(this.popupNode); - this.visible = false; - } - // logDebug("popup not visible"); -} -Popup.closeLink = function(options, text_link) { - options["href"] = "#"; - options["onclick"] = "Popup.hide()"; - return A(options, text_link); -} diff --git a/intranet/templates/accueil.tmpl b/intranet/templates/accueil.tmpl deleted file mode 100644 index eac35ea8..00000000 --- a/intranet/templates/accueil.tmpl +++ /dev/null @@ -1,17 +0,0 @@ -#encoding:utf-8 -
-#for a_category in $modules -
- $a_category -
    - #for a_module_name in $modules[a_category] - #set the_module = $modules[a_category][a_module_name] -
  • - icon - $the_module.name -
  • - #end for -
-
-#end for -
diff --git a/intranet/templates/error.tmpl b/intranet/templates/error.tmpl deleted file mode 100644 index aae48d73..00000000 --- a/intranet/templates/error.tmpl +++ /dev/null @@ -1,27 +0,0 @@ -#encoding:utf-8 - -Traveaux -
-

Erreur $status

-
-
-
Envoyer un rapport de bug - - -
- -
- - Retour à la page d'accueil -
- #if $message -
-

Message d'erreur

-
$message
-
- #end if -
-
-
-
-
diff --git a/intranet/templates/error403.tmpl b/intranet/templates/error403.tmpl deleted file mode 100644 index 29b07e7d..00000000 --- a/intranet/templates/error403.tmpl +++ /dev/null @@ -1,13 +0,0 @@ -#encoding:utf-8 - -Do Not Enter -
-

Accès interdit

- -
$message
- - - Retour à la page d'accueil -
- -
diff --git a/intranet/templates/login.tmpl b/intranet/templates/login.tmpl deleted file mode 100644 index 3b639e2c..00000000 --- a/intranet/templates/login.tmpl +++ /dev/null @@ -1,63 +0,0 @@ -#encoding:utf-8 - - - - - - .:: Cr@ns Intranet ::. - - - -

Bienvenue sur Cr@nsIntranet

- - -
-
- logocr@ns -

Connexion

-
-
- - #if $message -
- $message -
- #else -
- #end if - -
- -
- -
- -
- -
-
- - -
-
-

-

Liens Cr@ns

- -#import cherrypy -#set bugMail = cherrypy.config.get("mail.bugreport", "nounous@crans.org") -
-

L'intranet est en version beta, aidez-nous à - l'améliorer en nous envoyant vos remarques et en nous signalant tout - problème à $bugMail

-
-
- - - - diff --git a/intranet/templates/main.tmpl b/intranet/templates/main.tmpl deleted file mode 100644 index 324aa635..00000000 --- a/intranet/templates/main.tmpl +++ /dev/null @@ -1,72 +0,0 @@ -#import cherrypy -#encoding:utf-8 -#set bugMail = cherrypy.config.get("mail.bugreport", "nounous@crans.org") - - - - - - Cr@ns $getVar('title', 'Intranet') - - - - #if $getVar('stylesheets',False) - #for $a_stylesheet in $stylesheets - - #end for - #end if - - - - - - - - #if $getVar('scripts',False) - #for $a_script in $scripts - - #end for - #end if - - -
- - $page - -
-
-
-
- - -
-

-

Liens Cr@ns

- -
-

L'intranet est en version beta, aidez-nous à - l'améliorer en nous envoyant vos remarques et en nous signalant tout - problème à $bugMail. - S'il s'agit d'un bug lié à un fichier particulier, veuillez preciser son nom et si vous acceptez que nous l'examinions. - S'il s'agit d'un bourrage, adressez-vous à impression@lists.crans.org. - Si vous souhaitez etre recrédité, donnez un maximum de détails, le detail des fichiers et la somme totale.

-
-
-#if $environment == 'development' - -#end if - -