Difference between revisions of "Phonenumber"

From Catglobe Wiki
Jump to: navigation, search
Line 3: Line 3:
 
----
 
----
  
<br> Structure of Phone Number in CatGlobe system:
+
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]'''
 
</blockquote>  
 
 
{|
 
{|
 
|-
 
|-
Line 57: Line 55:
 
== 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 90: Line 88:
 
*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 &gt;= old value, and &lt;= 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 &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="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); ">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span>  
+
<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;
+
<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; <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;<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; &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;&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;<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; <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;&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; &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;/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;<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; &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;<span style="color: rgb(255, 0, 0);"> &nbsp; &lt;/country&gt;</span>  
  
 
&nbsp;&nbsp; &nbsp; &lt;country countrycode="32"&gt;  
 
&nbsp;&nbsp; &nbsp; &lt;country countrycode="32"&gt;  
Line 135: Line 133:
 
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;landline trunk="0" display="2-2-2"&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;&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;….  
Line 149: Line 147:
 
&nbsp;&nbsp; &nbsp; &lt;/country&gt;  
 
&nbsp;&nbsp; &nbsp; &lt;/country&gt;  
  
<span style="color: rgb(255, 0, 0); ">&lt;/Phonenumbers&gt;</span>
+
<span style="color: rgb(255, 0, 0);">&lt;/Phonenumbers&gt;</span>

Revision as of 09:24, 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
Mobile1 = 3
Home1 = 1
Mobile2 = 4
Home2 = 2
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>