[printing] Formatage du numéro de téléphone
This commit is contained in:
parent
45faa88482
commit
49709b663a
2 changed files with 12 additions and 1 deletions
|
@ -27,6 +27,16 @@ def blacklist(l):
|
|||
def split(str, *arg):
|
||||
return str.split(*arg)
|
||||
|
||||
def telephone(l):
|
||||
tel=[]
|
||||
for t in l:
|
||||
if len(str(t)) == 10:
|
||||
tel.append("%c%c.%c%c.%c%c.%c%c.%c%c" % tuple(map(ord, str(t))))
|
||||
else:
|
||||
if t.startswith("00"):
|
||||
t="+%s" % t[2:]
|
||||
tel.append(t)
|
||||
return tel
|
||||
|
||||
templateEnv=None
|
||||
def template():
|
||||
|
@ -42,6 +52,7 @@ def template():
|
|||
templateEnv.filters['prise_etat'] = prise_etat
|
||||
templateEnv.filters['timeformat'] = timeformat
|
||||
templateEnv.filters['split'] = split
|
||||
templateEnv.filters['telephone'] = telephone
|
||||
return templateEnv
|
||||
|
||||
def machine(machine, params):
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{["aid=",o.aid.0]|join|coul('bleu')}} {{"Nom : "|coul('gras')}}{{o.prenom|join(' ')}} {{o.nom|join(' ')}}
|
||||
{% endblock%}
|
||||
{% block proprio %}
|
||||
{{"Numéro de téléphone : "|coul('gras')}}{{o.tel|join(', ')}}
|
||||
{{"Numéro de téléphone : "|coul('gras')}}{{o.tel|telephone|join(', ')}}
|
||||
{{"Chambre : "|coul('gras')}}{{o.chbre.0}} ({{o.chbre.0|string|prise_etat}})
|
||||
{{"Études : "|coul('gras')}}{{o.etudes|join(' ')}}
|
||||
{{"Cotisation payée pour les années : "|coul('gras')}}{{o.paiement|join(' ')}} {% if o.get('controle', []) and 'p' in o.controle.0.value %}{{"(OK)"|coul('vert')}}{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue