Merge pull request #23587 from civicrm/5.50
[civicrm-core.git] / xml / schema / Core / Phone.xml
CommitLineData
6a488035
TO
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>
449c4e6b 10 <icon>fa-phone</icon>
8ab43c93 11 <labelField>phone</labelField>
6a488035 12 <field>
b05e6d0d
EM
13 <name>id</name>
14 <title>Phone ID</title>
15 <type>int unsigned</type>
16 <required>true</required>
17 <comment>Unique Phone ID</comment>
0481e12c
A
18 <html>
19 <type>Number</type>
20 </html>
b05e6d0d 21 <add>1.1</add>
6a488035
TO
22 </field>
23 <primaryKey>
b05e6d0d
EM
24 <name>id</name>
25 <autoincrement>true</autoincrement>
6a488035
TO
26 </primaryKey>
27 <field>
b05e6d0d 28 <name>contact_id</name>
047c5009 29 <title>Contact ID</title>
b05e6d0d
EM
30 <type>int unsigned</type>
31 <comment>FK to Contact ID</comment>
57e94608 32 <html>
047c5009 33 <label>Contact</label>
57e94608 34 </html>
b05e6d0d 35 <add>2.0</add>
6a488035
TO
36 </field>
37 <foreignKey>
b05e6d0d
EM
38 <name>contact_id</name>
39 <table>civicrm_contact</table>
40 <key>id</key>
41 <add>2.0</add>
42 <onDelete>CASCADE</onDelete>
6a488035
TO
43 </foreignKey>
44 <field>
b05e6d0d 45 <name>location_type_id</name>
1c0d6845 46 <title>Location Type ID</title>
b05e6d0d
EM
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>
1c0d6845 56 <label>Location Type</label>
b05e6d0d
EM
57 </html>
58 <add>2.0</add>
6a488035
TO
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>
b05e6d0d 66 <name>is_primary</name>
b6673dcd 67 <title>Primary phone</title>
b05e6d0d
EM
68 <type>boolean</type>
69 <default>0</default>
c1e814c7 70 <required>true</required>
b6673dcd
CW
71 <html>
72 <type>Radio</type>
73 </html>
b05e6d0d
EM
74 <comment>Is this the primary phone for this contact and location.</comment>
75 <add>1.1</add>
6a488035
TO
76 </field>
77 <index>
78 <name>index_is_primary</name>
79 <fieldName>is_primary</fieldName>
80 <add>2.0</add>
81 </index>
82 <field>
b05e6d0d
EM
83 <name>is_billing</name>
84 <title>Is Billing Phone</title>
85 <type>boolean</type>
86 <default>0</default>
c1e814c7 87 <required>true</required>
b05e6d0d
EM
88 <comment>Is this the billing?</comment>
89 <add>2.0</add>
6a488035
TO
90 </field>
91 <index>
92 <name>index_is_billing</name>
93 <fieldName>is_billing</fieldName>
94 <add>2.0</add>
95 </index>
96 <field>
b05e6d0d 97 <name>mobile_provider_id</name>
455cfd16 98 <title>Mobile Provider</title>
b05e6d0d
EM
99 <type>int unsigned</type>
100 <comment>Which Mobile Provider does this phone belong to.</comment>
101 <add>1.1</add>
6a488035
TO
102 </field>
103 <index>
b05e6d0d
EM
104 <name>UI_mobile_provider_id</name>
105 <fieldName>mobile_provider_id</fieldName>
106 <add>1.6</add>
6a488035
TO
107 </index>
108 <field>
b05e6d0d
EM
109 <name>phone</name>
110 <type>varchar</type>
111 <length>32</length>
112 <import>true</import>
113 <headerPattern>/phone/i</headerPattern>
114 <dataPattern>/^[\d\(\)\-\.\s]+$/</dataPattern>
115 <comment>Complete phone number.</comment>
116 <add>1.1</add>
a6c04811
TM
117 <html>
118 <type>Text</type>
fd735f54 119 <label>Phone</label>
a6c04811 120 </html>
6a488035
TO
121 </field>
122 <field>
b05e6d0d
EM
123 <name>phone_ext</name>
124 <title>Phone Extension</title>
125 <type>varchar</type>
126 <length>16</length>
127 <html>
128 <type>Text</type>
54f5e87f 129 <size>4</size>
b05e6d0d
EM
130 </html>
131 <import>true</import>
132 <export>true</export>
133 <headerPattern>/extension/i</headerPattern>
134 <dataPattern>/^\d+$/</dataPattern>
135 <comment>Optional extension for a phone number.</comment>
136 <add>3.3</add>
6a488035
TO
137 </field>
138 <field>
b05e6d0d
EM
139 <name>phone_numeric</name>
140 <type>varchar</type>
141 <length>32</length>
142 <comment>Phone number stripped of all whitespace, letters, and punctuation.</comment>
1662d426
A
143 <html>
144 <label>Numeric</label>
145 </html>
b05e6d0d 146 <add>4.3</add>
6a488035
TO
147 </field>
148 <index>
149 <name>index_phone_numeric</name>
150 <fieldName>phone_numeric</fieldName>
151 <add>4.3</add>
152 </index>
6a488035 153 <field>
b05e6d0d 154 <name>phone_type_id</name>
0b23ab2b 155 <title>Phone Type ID</title>
b05e6d0d 156 <type>int unsigned</type>
219c47d6 157 <export>true</export>
b05e6d0d
EM
158 <comment>Which type of phone does this number belongs.</comment>
159 <pseudoconstant>
160 <optionGroupName>phone_type</optionGroupName>
161 </pseudoconstant>
162 <html>
163 <type>Select</type>
9ac33d0f 164 <label>Phone Type</label>
b05e6d0d
EM
165 </html>
166 <add>2.2</add>
3c7d2158 167 </field>
6a488035 168</table>