Commit 831a7f81 authored by Rafael Monnerat's avatar Rafael Monnerat

Bug Fix for:

"Telephone drops the last piece after - 

for example, try to enter +11(0)11-1111-1111 as a telephone number. then it becomes +11(0)11-1111
telephone should not eliminate any part."




git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24426 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 31d08a30
......@@ -73,9 +73,10 @@ class Telephone(Coordinate, Base):
regex_list = [
# Country, Area, Number, Extension*
# +11(0)1-11111111/111 or +11(0)1-11111111/ or +11(0)1-11111111
# +11(0)1-1111-1111/111 or +11(0)1-1111-1111/ or +11(0)1-1111-1111
# + 11 (0)1-11 11 01 01/111 or + 11 (0)1-11 11 01 01/ or + 11 (0)1-11 11 01 01
# +11 (0)11 1011 1100/111 or +11 (0)11 1011 1100/ or +11 (0)11 1011 1100
"\+(?P<country>[\d\ ]*)\(0\)(?P<area>\d+)(\-|\ )(?P<number>[\d\ ]*)(?:\/)?(?P<ext>\d+|)",
"\+(?P<country>[\d\ ]*)\(0\)(?P<area>\d+)(\-|\ )(?P<number>[\d\ \-]*)(?:\/)?(?P<ext>\d+|)",
# Country, Area, Number, Extension*
# +11-1-11111111/111 or +11-1-11111111/ or +11-1-11111111
......
......@@ -1076,6 +1076,7 @@ class TestERP5Base(ERP5TypeTestCase):
['+111/1/1111 1100/111', '+111(0)1-11111100/111'],
['+111/1/1111 1100/', '+111(0)1-11111100'],
['+111/1/1111 1100', '+111(0)1-11111100'],
['+11(0)11-1111-1111/111', '+11(0)11-11111111/111'],
]
for i in input_list:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment