Difference between revisions of "Phonenumber"
(→Validation rule:) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
---- | ---- | ||
− | + | Structure of Phone Number in CatGlobe system: | |
− | <blockquote> | + | <blockquote>'''<sup></sup><sup></sup>[country_number][area_code][number][extension]''' </blockquote> |
− | '''<sup></sup><sup></sup>[country_number][area_code][number][extension]''' | + | {| border="1" |
− | </blockquote> | ||
− | {| | ||
|- | |- | ||
− | ! RESOURCE | + | ! '''RESOURCE''' |
− | ! LAND LINE | + | ! '''LAND LINE''' |
− | ! | + | ! '''MOBILE''' |
|- | |- | ||
− | | USER | + | | rowspan="7" | '''USER ''' |
| NotIdentified = 0 | | NotIdentified = 0 | ||
+ | | | ||
|- | |- | ||
− | | | + | | Home1 = 1 |
| Mobile1 = 3 | | Mobile1 = 3 | ||
|- | |- | ||
− | | | + | | Home2 = 2 |
− | |||
− | |||
− | |||
| Mobile2 = 4 | | Mobile2 = 4 | ||
|- | |- | ||
− | |||
− | |||
− | |||
− | |||
| Business1 = 5 | | Business1 = 5 | ||
− | | | + | | |
− | | | + | |- |
| Business2 = 6 | | Business2 = 6 | ||
+ | | | ||
|- | |- | ||
− | |||
| HomeFax = 7 | | HomeFax = 7 | ||
+ | | | ||
|- | |- | ||
− | |||
| BusinessFax =8 | | BusinessFax =8 | ||
+ | | | ||
|- | |- | ||
− | | GROUP | + | | rowspan="4" |''' GROUP ''' |
| Main1 = 9 | | Main1 = 9 | ||
+ | | | ||
|- | |- | ||
− | |||
| Main2 = 10 | | Main2 = 10 | ||
+ | | | ||
|- | |- | ||
− | |||
| Fax1 = 11 | | Fax1 = 11 | ||
+ | | | ||
|- | |- | ||
− | |||
| Fax2 = 12 | | Fax2 = 12 | ||
+ | | | ||
|} | |} | ||
Line 57: | Line 51: | ||
== Validation rule: == | == Validation rule: == | ||
− | *All characters must be digits, from 0-9. | + | *All characters must be digits, from 0-9. |
*Mobile Types don't have [area_code] and [extension] [extension]: max length is 9 digits. | *Mobile Types don't have [area_code] and [extension] [extension]: max length is 9 digits. | ||
*If [country_number] isn't supported on XML file. Valid value must be from 6 to 14 digits. | *If [country_number] isn't supported on XML file. Valid value must be from 6 to 14 digits. | ||
Line 63: | Line 57: | ||
*Valid phone number must satisfies all attributes belong to one of the available <possiblenumber> attributes. | *Valid phone number must satisfies all attributes belong to one of the available <possiblenumber> attributes. | ||
− | {| | + | {|border="1" |
− | |- | + | |- |
| [area_code] | | [area_code] | ||
| Must followed rules specified by <area> attribute | | Must followed rules specified by <area> attribute | ||
Line 90: | Line 84: | ||
*When uploading a phone rule, upload file must conform to the following things: | *When uploading a phone rule, upload file must conform to the following things: | ||
− | #XML file. | + | #XML file. |
− | #Must have <span style="color: rgb(0, 0, 255); ">date </span>attribute. And this new value must >= old value, and <= current date Country code is pre-defined in system (hardcode) and There's no duplicate value. | + | #Must have <span style="color: rgb(0, 0, 255);">date </span>attribute. And this new value must >= old value, and <= current date Country code is pre-defined in system (hardcode) and There's no duplicate value. |
− | #"<span style="color: rgb(0, 0, 255); ">Area</span>" attribute only available for "Landline" phone type (<span style="color: rgb(255, 0, 0); ">landline</span> element) | + | #"<span style="color: rgb(0, 0, 255);">Area</span>" attribute only available for "Landline" phone type (<span style="color: rgb(255, 0, 0);">landline</span> element) |
− | #<span style="background-color: rgb(255, 204, 0); ">Regexps </span>provided are valid. | + | #<span style="background-color: rgb(255, 204, 0);">Regexps </span>provided are valid. |
Structure of XML file: | Structure of XML file: | ||
− | <span style="color: rgb(51, 153, 102); "><?xml version="1.0" encoding="utf-8"?></span> | + | <span style="color: rgb(51, 153, 102);"><?xml version="1.0" encoding="utf-8"?></span> |
− | <span style="color: rgb(255, 0, 0); "><Phonenumbers</span> <span style="color: rgb(0, 0, 255); ">date</span>="2008-04-16"> | + | <span style="color: rgb(255, 0, 0);"><Phonenumbers</span> <span style="color: rgb(0, 0, 255);">date</span>="2008-04-16"> |
− | <span style="color: rgb(255, 0, 0); "><</span><span style="color: rgb(255, 0, 0); ">country </span><span style="color: rgb(0, 0, 255); ">countrycode</span>="31"> | + | <span style="color: rgb(255, 0, 0);"><</span><span style="color: rgb(255, 0, 0);">country </span><span style="color: rgb(0, 0, 255);">countrycode</span>="31"> |
− | <span style="color: rgb(255, 0, 0); "><mobile </span><span style="color: rgb(0, 0, 255); ">trunk</span>="0" <span style="color: rgb(0, 0, 255); ">display</span>="3-3-3"> | + | <span style="color: rgb(255, 0, 0);"><mobile </span><span style="color: rgb(0, 0, 255);">trunk</span>="0" <span style="color: rgb(0, 0, 255);">display</span>="3-3-3"> |
− | <span style="color: rgb(255, 0, 0); "><possiblenumber</span> <span style="color: rgb(0, 0, 255); ">number</span>=<span style="background-color: rgb(255, 153, 0); ">"6\d{8}"</span> <span style="color: rgb(0, 0, 255); ">numberdoc</span>="6 followed by 8 digits"/> | + | <span style="color: rgb(255, 0, 0);"><possiblenumber</span> <span style="color: rgb(0, 0, 255);">number</span>=<span style="background-color: rgb(255, 153, 0);">"6\d{8}"</span> <span style="color: rgb(0, 0, 255);">numberdoc</span>="6 followed by 8 digits"/> |
− | <<span style="color: rgb(255, 0, 0); ">/mobile</span>> | + | <<span style="color: rgb(255, 0, 0);">/mobile</span>> |
− | <span style="color: rgb(255, 0, 0); "><landline</span> <span style="color: rgb(0, 0, 255); ">trunk</span>="0" <span style="color: rgb(0, 0, 255); ">display</span>="3-3-3"> | + | <span style="color: rgb(255, 0, 0);"><landline</span> <span style="color: rgb(0, 0, 255);">trunk</span>="0" <span style="color: rgb(0, 0, 255);">display</span>="3-3-3"> |
− | <span style="color: rgb(255, 0, 0); "> <possiblenumber</span> <span style="color: rgb(0, 0, 255); ">area</span>=<span style="background-color: rgb(255, 153, 0); ">"[1-5]0"</span> <span style="color: rgb(0, 0, 255); ">areadoc</span>="1 to 5 followed by a zero" <span style="color: rgb(0, 0, 255); ">number</span>=<span style="background-color: rgb(255, 153, 0); ">"\d{7}"</span> <span style="color: rgb(0, 0, 255); ">numberdoc</span>="7 digits"/> | + | <span style="color: rgb(255, 0, 0);"> <possiblenumber</span> <span style="color: rgb(0, 0, 255);">area</span>=<span style="background-color: rgb(255, 153, 0);">"[1-5]0"</span> <span style="color: rgb(0, 0, 255);">areadoc</span>="1 to 5 followed by a zero" <span style="color: rgb(0, 0, 255);">number</span>=<span style="background-color: rgb(255, 153, 0);">"\d{7}"</span> <span style="color: rgb(0, 0, 255);">numberdoc</span>="7 digits"/> |
… | … | ||
− | <possiblenumber number=<span style="background-color: rgb(255, 153, 0); ">"\d{9}"</span> numberdoc="9 digits"/> | + | <possiblenumber number=<span style="background-color: rgb(255, 153, 0);">"\d{9}"</span> numberdoc="9 digits"/> |
− | <span style="color: rgb(255, 0, 0); "></landline></span> | + | <span style="color: rgb(255, 0, 0);"></landline></span> |
− | <span style="color: rgb(255, 0, 0); "><example></span>+31 703-333-333<span style="color: rgb(255, 0, 0); "></example></span> | + | <span style="color: rgb(255, 0, 0);"><example></span>+31 703-333-333<span style="color: rgb(255, 0, 0);"></example></span> |
<example>+31 561-123-456</example> | <example>+31 561-123-456</example> | ||
− | <span style="color: rgb(255, 0, 0); "> </country></span> | + | <span style="color: rgb(255, 0, 0);"> </country></span> |
<country countrycode="32"> | <country countrycode="32"> | ||
Line 135: | Line 129: | ||
<landline trunk="0" display="2-2-2"> | <landline trunk="0" display="2-2-2"> | ||
− | <possiblenumber area="[239]" areadoc="2, 3 or 9" number="\d{7}" numberdoc="7 digits"/> | + | <possiblenumber area="[239]" areadoc="2, 3 or 9" number="\d{7}" numberdoc="7 digits"/> |
…. | …. | ||
Line 149: | Line 143: | ||
</country> | </country> | ||
− | <span style="color: rgb(255, 0, 0); "></Phonenumbers></span> | + | <span style="color: rgb(255, 0, 0);"></Phonenumbers></span> |
Latest revision as of 09:33, 6 August 2010
Contents
PHONE NUMBER
Structure of Phone Number in CatGlobe system:
[country_number][area_code][number][extension]
RESOURCE | LAND LINE | MOBILE |
---|---|---|
USER | NotIdentified = 0 | |
Home1 = 1 | Mobile1 = 3 | |
Home2 = 2 | Mobile2 = 4 | |
Business1 = 5 | ||
Business2 = 6 | ||
HomeFax = 7 | ||
BusinessFax =8 | ||
GROUP | Main1 = 9 | |
Main2 = 10 | ||
Fax1 = 11 | ||
Fax2 = 12 |
These value is defined in CatGlobe\Domain\PhoneNumbers\PhonenumberType.cs
Validation rule:
- All characters must be digits, from 0-9.
- Mobile Types don't have [area_code] and [extension] [extension]: max length is 9 digits.
- If [country_number] isn't supported on XML file. Valid value must be from 6 to 14 digits.
- If [country_number] is supported, Using rules in XML file to decide which format phone numbers are legal for different countries. (Tools → Administration → System → Language and Culture Settings → Phone number parser tab).
- Valid phone number must satisfies all attributes belong to one of the available <possiblenumber> attributes.
[area_code] | Must followed rules specified by <area> attribute |
[number] | Must followed rules specified by <number> attribute |
Logic when Import, Update Phone number for User, Group:
- By Phone number control in General Information of Resource CRD:
- In PhoneType dropdown, The phone type have the exist value will be grey.
- If Phone number Label show in red and number field is empty, it means that this is invalid phone number exists on DB. After User corrected , It will be blue.
- If User input a invalid value, a little red text will be displayed under phone number control for notification.
- By Import User's Phonenumber (Import module): Validation Rule will be applied as normal. Phone number option must be selected.
Phone number Parser:
Tools → Administration → System → Language and Culture Settings → Phone number parser tab
- Download and Upload XML File used to validate phone number
- Path to locate XML file is specified by key "FilePath" in CatGlobeWeb\Web.config If there's any existing XML file in Path, Default file will be used (located at Catglobe\Domain\PhoneNumbers\Rule\default_rules.xml
- When uploading a phone rule, upload file must conform to the following things:
- XML file.
- Must have date attribute. And this new value must >= old value, and <= current date Country code is pre-defined in system (hardcode) and There's no duplicate value.
- "Area" attribute only available for "Landline" phone type (landline element)
- Regexps provided are valid.
Structure of XML file:
<?xml version="1.0" encoding="utf-8"?>
<Phonenumbers date="2008-04-16">
<country countrycode="31">
<mobile trunk="0" display="3-3-3">
<possiblenumber number="6\d{8}" numberdoc="6 followed by 8 digits"/>
</mobile>
<landline trunk="0" display="3-3-3">
<possiblenumber area="[1-5]0" areadoc="1 to 5 followed by a zero" number="\d{7}" numberdoc="7 digits"/>
…
<possiblenumber number="\d{9}" numberdoc="9 digits"/>
</landline>
<example>+31 703-333-333</example>
<example>+31 561-123-456</example>
</country>
<country countrycode="32">
<mobile trunk="0" display="2-2-2-2">
<possiblenumber number="75\d{6}" numberdoc="75 followed by 6 digits"/>
</mobile>
<landline trunk="0" display="2-2-2">
<possiblenumber area="[239]" areadoc="2, 3 or 9" number="\d{7}" numberdoc="7 digits"/>
….
<possiblenumber number="\d{8}" numberdoc="8 digits"/>
</landline>
<example>+32 61-12-23-34</example>
<example>+32 19-00-11-00</example>
</country>
</Phonenumbers>