Merge pull request #21944 from masetto/unit_plural
[civicrm-core.git] / xml / schema / Core / Phone.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>Phone</class>
6 <name>civicrm_phone</name>
7 <comment>Phone information for a specific location.</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <icon>fa-phone</icon>
11 <labelField>phone</labelField>
12 <field>
13 <name>id</name>
14 <title>Phone ID</title>
15 <type>int unsigned</type>
16 <required>true</required>
17 <comment>Unique Phone ID</comment>
18 <html>
19 <type>Number</type>
20 </html>
21 <add>1.1</add>
22 </field>
23 <primaryKey>
24 <name>id</name>
25 <autoincrement>true</autoincrement>
26 </primaryKey>
27 <field>
28 <name>contact_id</name>
29 <title>Contact ID</title>
30 <type>int unsigned</type>
31 <comment>FK to Contact ID</comment>
32 <html>
33 <label>Contact</label>
34 </html>
35 <add>2.0</add>
36 </field>
37 <foreignKey>
38 <name>contact_id</name>
39 <table>civicrm_contact</table>
40 <key>id</key>
41 <add>2.0</add>
42 <onDelete>CASCADE</onDelete>
43 </foreignKey>
44 <field>
45 <name>location_type_id</name>
46 <title>Location Type ID</title>
47 <type>int unsigned</type>
48 <comment>Which Location does this phone belong to.</comment>
49 <pseudoconstant>
50 <table>civicrm_location_type</table>
51 <keyColumn>id</keyColumn>
52 <labelColumn>display_name</labelColumn>
53 </pseudoconstant>
54 <html>
55 <type>Select</type>
56 <label>Location Type</label>
57 </html>
58 <add>2.0</add>
59 </field>
60 <index>
61 <name>index_location_type</name>
62 <fieldName>location_type_id</fieldName>
63 <add>2.0</add>
64 </index>
65 <field>
66 <name>is_primary</name>
67 <title>Primary phone</title>
68 <type>boolean</type>
69 <default>0</default>
70 <html>
71 <type>Radio</type>
72 </html>
73 <comment>Is this the primary phone for this contact and location.</comment>
74 <add>1.1</add>
75 </field>
76 <index>
77 <name>index_is_primary</name>
78 <fieldName>is_primary</fieldName>
79 <add>2.0</add>
80 </index>
81 <field>
82 <name>is_billing</name>
83 <title>Is Billing Phone</title>
84 <type>boolean</type>
85 <default>0</default>
86 <comment>Is this the billing?</comment>
87 <add>2.0</add>
88 </field>
89 <index>
90 <name>index_is_billing</name>
91 <fieldName>is_billing</fieldName>
92 <add>2.0</add>
93 </index>
94 <field>
95 <name>mobile_provider_id</name>
96 <title>Mobile Provider</title>
97 <type>int unsigned</type>
98 <comment>Which Mobile Provider does this phone belong to.</comment>
99 <add>1.1</add>
100 </field>
101 <index>
102 <name>UI_mobile_provider_id</name>
103 <fieldName>mobile_provider_id</fieldName>
104 <add>1.6</add>
105 </index>
106 <field>
107 <name>phone</name>
108 <type>varchar</type>
109 <length>32</length>
110 <import>true</import>
111 <headerPattern>/phone/i</headerPattern>
112 <dataPattern>/^[\d\(\)\-\.\s]+$/</dataPattern>
113 <comment>Complete phone number.</comment>
114 <add>1.1</add>
115 <html>
116 <type>Text</type>
117 <label>Phone</label>
118 </html>
119 </field>
120 <field>
121 <name>phone_ext</name>
122 <title>Phone Extension</title>
123 <type>varchar</type>
124 <length>16</length>
125 <html>
126 <type>Text</type>
127 <size>4</size>
128 </html>
129 <import>true</import>
130 <export>true</export>
131 <headerPattern>/extension/i</headerPattern>
132 <dataPattern>/^\d+$/</dataPattern>
133 <comment>Optional extension for a phone number.</comment>
134 <add>3.3</add>
135 </field>
136 <field>
137 <name>phone_numeric</name>
138 <type>varchar</type>
139 <length>32</length>
140 <comment>Phone number stripped of all whitespace, letters, and punctuation.</comment>
141 <html>
142 <label>Numeric</label>
143 </html>
144 <add>4.3</add>
145 </field>
146 <index>
147 <name>index_phone_numeric</name>
148 <fieldName>phone_numeric</fieldName>
149 <add>4.3</add>
150 </index>
151 <field>
152 <name>phone_type_id</name>
153 <title>Phone Type ID</title>
154 <type>int unsigned</type>
155 <export>true</export>
156 <comment>Which type of phone does this number belongs.</comment>
157 <pseudoconstant>
158 <optionGroupName>phone_type</optionGroupName>
159 </pseudoconstant>
160 <html>
161 <type>Select</type>
162 <label>Phone Type</label>
163 </html>
164 <add>2.2</add>
165 </field>
166 </table>