Difference between revisions of "Phonenumber"

From Catglobe Wiki
Jump to: navigation, search
(Created page with '= '''PHONE NUMBER''' = <hr> <br> Structure of Phone Number in CatGlobe system: '''[country_number][area_code][number][extension]''' {| |- ! -RESOURCE ! -LAND LINE ! -MOBILE …')
 
(Validation rule:)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= '''PHONE NUMBER'''  =
 
= '''PHONE NUMBER'''  =
<hr>
 
<br> Structure of Phone Number in CatGlobe system: '''[country_number][area_code][number][extension]'''
 
  
{|
+
----
 +
 
 +
Structure of Phone Number in CatGlobe system:
 +
<blockquote>'''<sup></sup><sup></sup>[country_number][area_code][number][extension]''' </blockquote>
 +
{| border="1"
 
|-
 
|-
! -RESOURCE  
+
! '''RESOURCE'''
! -LAND LINE  
+
! '''LAND LINE'''
! -MOBILE
+
! '''MOBILE'''
 
|-
 
|-
| USER  
+
| rowspan="7" | '''USER '''
 
| NotIdentified = 0
 
| NotIdentified = 0
 +
|
 
|-
 
|-
|  
+
| Home1 = 1
 
| Mobile1 = 3
 
| Mobile1 = 3
 
|-
 
|-
|  
+
| Home2 = 2
| Home1 = 1
 
|-
 
|
 
 
| Mobile2 = 4
 
| Mobile2 = 4
 
|-
 
|-
|
 
| Home2 = 2
 
|-
 
|
 
 
| 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 53: 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 59: Line 57:
 
*Valid phone number must satisfies all attributes belong to one of the available &lt;possiblenumber&gt; attributes.
 
*Valid phone number must satisfies all attributes belong to one of the available &lt;possiblenumber&gt; attributes.
  
{|
+
{|border="1"
|-
+
|-  
 
| [area_code]  
 
| [area_code]  
 
| Must followed rules specified by &lt;area&gt; attribute
 
| Must followed rules specified by &lt;area&gt; attribute
Line 68: Line 66:
 
|}
 
|}
  
==Logic when Import, Update Phone number for User, Group:  
+
== Logic when Import, Update Phone number for User, Group: ==
  
 
*By Phone number control in General Information of Resource CRD:  
 
*By Phone number control in General Information of Resource CRD:  
Line 75: Line 73:
 
**If User input a invalid value, a little red text will be displayed under phone number control for notification.  
 
**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.
 
*By Import User's Phonenumber (Import module): Validation Rule will be applied as normal. Phone number option must be selected.
<hr>
+
 
==Phone number Parser:==  
+
----
 +
 
 +
== Phone number Parser: ==
 +
 
 
Tools → Administration → System → Language and Culture Settings → Phone number parser tab  
 
Tools → Administration → System → Language and Culture Settings → Phone number parser tab  
  
Line 83: 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. Must have date attribute. And this new value must &gt;= old value, and &lt;= current date Country code is pre-defined in system (hardcode) and There's no duplicate value. "Area" attribute only available for "Landline" phone type. Regexps provided are valid. Structure of XML file: &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Phonenumbers date="2008-04-16"&gt; &lt;country countrycode="31"&gt; &lt;mobile trunk="0" display="3-3-3"&gt; &lt;possiblenumber number="6\d{8}" numberdoc="6 followed by 8 digits"/&gt; &lt;/mobile&gt; &lt;landline trunk="0" display="3-3-3"&gt; &lt;possiblenumber area="[1-5]0" areadoc="1 to 5 followed by a zero" number="\d{7}" numberdoc="7 digits"/&gt; … &lt;possiblenumber number="\d{9}" numberdoc="9 digits"/&gt; &lt;/landline&gt; &lt;example&gt;+31 703-333-333&lt;/example&gt; &lt;example&gt;+31 561-123-456&lt;/example&gt; &lt;/country&gt; &lt;country countrycode="32"&gt; &lt;mobile trunk="0" display="2-2-2-2"&gt; &lt;possiblenumber number="75\d{6}" numberdoc="75 followed by 6 digits"/&gt; &lt;/mobile&gt; &lt;landline trunk="0" display="2-2-2"&gt; &lt;possiblenumber area="[239]" areadoc="2, 3 or 9" number="\d{7}" numberdoc="7 digits"/&gt; …. &lt;possiblenumber number="\d{8}" numberdoc="8 digits"/&gt; &lt;/landline&gt; &lt;example&gt;+32 61-12-23-34&lt;/example&gt; &lt;example&gt;+32 19-00-11-00&lt;/example&gt; &lt;/country&gt; &lt;/Phonenumbers&gt;
+
#XML file.  
 +
#Must have <span style="color: rgb(0, 0, 255);">date </span>attribute. And this new value must &gt;= old value, and &lt;= 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="background-color: rgb(255, 204, 0);">Regexps </span>provided are valid.
 +
 
 +
Structure of XML file:  
 +
 
 +
<span style="color: rgb(51, 153, 102);">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span>
 +
 
 +
<span style="color: rgb(255, 0, 0);">&lt;Phonenumbers</span> <span style="color: rgb(0, 0, 255);">date</span>="2008-04-16"&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&lt;</span><span style="color: rgb(255, 0, 0);">country </span><span style="color: rgb(0, 0, 255);">countrycode</span>="31"&gt;  
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: rgb(255, 0, 0);">&lt;mobile </span><span style="color: rgb(0, 0, 255);">trunk</span>="0" <span style="color: rgb(0, 0, 255);">display</span>="3-3-3"&gt;  
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: rgb(255, 0, 0);">&lt;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"/&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;<span style="color: rgb(255, 0, 0);">/mobile</span>&gt;  
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: rgb(255, 0, 0);">&lt;landline</span> <span style="color: rgb(0, 0, 255);">trunk</span>="0" <span style="color: rgb(0, 0, 255);">display</span>="3-3-3"&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&nbsp;&lt;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"/&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; …  
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;possiblenumber number=<span style="background-color: rgb(255, 153, 0);">"\d{9}"</span> numberdoc="9 digits"/&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: rgb(255, 0, 0);">&lt;/landline&gt;</span>
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: rgb(255, 0, 0);">&lt;example&gt;</span>+31 703-333-333<span style="color: rgb(255, 0, 0);">&lt;/example&gt;</span>
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;example&gt;+31 561-123-456&lt;/example&gt;
 +
 
 +
&nbsp;&nbsp;<span style="color: rgb(255, 0, 0);"> &nbsp; &lt;/country&gt;</span>
 +
 
 +
&nbsp;&nbsp; &nbsp; &lt;country countrycode="32"&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;mobile trunk="0" display="2-2-2-2"&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;possiblenumber number="75\d{6}" numberdoc="75 followed by 6 digits"/&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/mobile&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;landline trunk="0" display="2-2-2"&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;possiblenumber area="[239]" areadoc="2, 3 or 9" number="\d{7}" numberdoc="7 digits"/&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;….  
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;possiblenumber number="\d{8}" numberdoc="8 digits"/&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/landline&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;example&gt;+32 61-12-23-34&lt;/example&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;example&gt;+32 19-00-11-00&lt;/example&gt;
 +
 
 +
&nbsp;&nbsp; &nbsp; &lt;/country&gt;  
 +
 
 +
<span style="color: rgb(255, 0, 0);">&lt;/Phonenumbers&gt;</span>

Latest revision as of 09:33, 6 August 2010

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:
  1. XML file.
  2. 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.
  3. "Area" attribute only available for "Landline" phone type (landline element)
  4. 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>