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