Merge pull request #23073 from colemanw/contactTypeIcon
[civicrm-core.git] / xml / schema / Core / CustomField.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>CustomField</class>
6 <name>civicrm_custom_field</name>
7 <comment>Stores info about an extended (custom) property (data and form field info).</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <labelField>label</labelField>
11 <paths>
12 <add>civicrm/admin/custom/group/field/add?reset=1&amp;action=add&amp;gid=[custom_group_id]</add>
13 <update>civicrm/admin/custom/group/field/update?action=update&amp;reset=1&amp;id=[id]&amp;gid=[custom_group_id]</update>
14 <preview>civicrm/admin/custom/group/preview?reset=1&amp;fid=[id]</preview>
15 <delete>civicrm/admin/custom/group/field/delete?reset=1&amp;id=[id]</delete>
16 <move>civicrm/admin/custom/group/field/move?reset=1&amp;fid=[id]</move>
17 </paths>
18 <field>
19 <name>id</name>
20 <type>int unsigned</type>
21 <title>Custom Field ID</title>
22 <required>true</required>
23 <comment>Unique Custom Field ID</comment>
24 <html>
25 <type>Number</type>
26 </html>
27 <add>1.1</add>
28 </field>
29 <primaryKey>
30 <name>id</name>
31 <autoincrement>true</autoincrement>
32 </primaryKey>
33 <field>
34 <name>custom_group_id</name>
35 <type>int unsigned</type>
36 <title>Custom Group ID</title>
37 <required>true</required>
38 <comment>FK to civicrm_custom_group.</comment>
39 <add>1.1</add>
40 <pseudoconstant>
41 <table>civicrm_custom_group</table>
42 <keyColumn>id</keyColumn>
43 <labelColumn>title</labelColumn>
44 </pseudoconstant>
45 <html>
46 <type>Select</type>
47 <label>Custom Group</label>
48 </html>
49 </field>
50 <foreignKey>
51 <name>custom_group_id</name>
52 <table>civicrm_custom_group</table>
53 <key>id</key>
54 <add>1.1</add>
55 <onDelete>CASCADE</onDelete>
56 </foreignKey>
57 <field>
58 <name>name</name>
59 <type>varchar</type>
60 <title>Custom Field Name</title>
61 <length>64</length>
62 <comment>Variable name/programmatic handle for this field.</comment>
63 <add>3.3</add>
64 </field>
65 <field>
66 <name>label</name>
67 <type>varchar</type>
68 <title>Custom Field Label</title>
69 <length>255</length>
70 <required>true</required>
71 <localizable>true</localizable>
72 <comment>Text for form field label (also friendly name for administering this custom property).</comment>
73 <add>1.1</add>
74 </field>
75 <field>
76 <name>data_type</name>
77 <type>varchar</type>
78 <title>Data Type</title>
79 <length>16</length>
80 <required>true</required>
81 <comment>Controls location of data storage in extended_data table.</comment>
82 <pseudoconstant>
83 <callback>CRM_Core_BAO_CustomField::dataType</callback>
84 </pseudoconstant>
85 <add>1.1</add>
86 <html>
87 <type>Select</type>
88 <label>Data Type</label>
89 </html>
90 </field>
91 <field>
92 <name>html_type</name>
93 <type>varchar</type>
94 <title>HTML Type</title>
95 <length>32</length>
96 <required>true</required>
97 <comment>HTML types plus several built-in extended types.</comment>
98 <pseudoconstant>
99 <callback>CRM_Core_SelectValues::customHtmlType</callback>
100 </pseudoconstant>
101 <html>
102 <type>Select</type>
103 <label>Field Input Type</label>
104 </html>
105 <add>1.1</add>
106 </field>
107 <field>
108 <name>default_value</name>
109 <type>varchar</type>
110 <title>Custom Field Default</title>
111 <length>255</length>
112 <comment>Use form_options.is_default for field_types which use options.</comment>
113 <add>1.1</add>
114 </field>
115 <field>
116 <name>is_required</name>
117 <title>Custom Field Is Required?</title>
118 <type>boolean</type>
119 <comment>Is a value required for this property.</comment>
120 <default>0</default>
121 <add>1.1</add>
122 </field>
123 <field>
124 <name>is_searchable</name>
125 <title>Allow Searching on Field?</title>
126 <type>boolean</type>
127 <comment>Is this property searchable.</comment>
128 <default>0</default>
129 <add>1.1</add>
130 </field>
131 <field>
132 <name>is_search_range</name>
133 <type>boolean</type>
134 <title>Search as a Range</title>
135 <comment>Is this property range searchable.</comment>
136 <add>1.4</add>
137 <default>0</default>
138 </field>
139 <field>
140 <name>weight</name>
141 <type>int</type>
142 <title>Order</title>
143 <required>true</required>
144 <default>1</default>
145 <comment>Controls field display order within an extended property group.</comment>
146 <add>1.1</add>
147 </field>
148 <field>
149 <name>help_pre</name>
150 <type>text</type>
151 <title>Custom Field Pre Text</title>
152 <localizable>true</localizable>
153 <comment>Description and/or help text to display before this field.</comment>
154 <add>1.1</add>
155 </field>
156 <field>
157 <name>help_post</name>
158 <type>text</type>
159 <title>Custom Field Post Text</title>
160 <localizable>true</localizable>
161 <comment>Description and/or help text to display after this field.</comment>
162 <add>1.1</add>
163 </field>
164 <field>
165 <name>mask</name>
166 <type>varchar</type>
167 <title>Custom Field Formatting</title>
168 <length>64</length>
169 <comment>Optional format instructions for specific field types, like date types.</comment>
170 <add>1.1</add>
171 </field>
172 <field>
173 <name>attributes</name>
174 <type>varchar</type>
175 <title>Custom Field Attributes</title>
176 <length>255</length>
177 <comment>Store collection of type-appropriate attributes, e.g. textarea needs rows/cols attributes</comment>
178 <add>1.1</add>
179 </field>
180 <field>
181 <name>javascript</name>
182 <type>varchar</type>
183 <title>Custom Field Javascript</title>
184 <length>255</length>
185 <comment>Optional scripting attributes for field.</comment>
186 <add>1.1</add>
187 </field>
188 <field>
189 <name>is_active</name>
190 <type>boolean</type>
191 <title>Custom Field Is Active?</title>
192 <comment>Is this property active?</comment>
193 <default>1</default>
194 <add>1.1</add>
195 </field>
196 <field>
197 <name>is_view</name>
198 <type>boolean</type>
199 <title>Field is Viewable</title>
200 <default>0</default>
201 <comment>Is this property set by PHP Code? A code field is viewable but not editable</comment>
202 <add>1.1</add>
203 </field>
204 <field>
205 <name>options_per_line</name>
206 <type>int unsigned</type>
207 <title>Field Options Per Line</title>
208 <comment>number of options per line for checkbox and radio</comment>
209 </field>
210 <field>
211 <name>text_length</name>
212 <type>int unsigned</type>
213 <title>Field Length</title>
214 <comment>field length if alphanumeric</comment>
215 <add>2.2</add>
216 </field>
217 <field>
218 <name>start_date_years</name>
219 <type>int</type>
220 <title>Field Start Date</title>
221 <comment>Date may be up to start_date_years years prior to the current date.</comment>
222 <add>1.4</add>
223 </field>
224 <field>
225 <name>end_date_years</name>
226 <type>int</type>
227 <title>Field End Date</title>
228 <comment>Date may be up to end_date_years years after the current date.</comment>
229 <add>1.4</add>
230 </field>
231 <field>
232 <name>date_format</name>
233 <type>varchar</type>
234 <title>Field Data Format</title>
235 <length>64</length>
236 <comment>date format for custom date</comment>
237 <add>3.1</add>
238 <pseudoconstant>
239 <callback>CRM_Core_SelectValues::getDatePluginInputFormats</callback>
240 </pseudoconstant>
241 </field>
242 <field>
243 <name>time_format</name>
244 <type>int unsigned</type>
245 <title>Field Time Format</title>
246 <comment>time format for custom date</comment>
247 <add>3.1</add>
248 <pseudoconstant>
249 <callback>CRM_Core_SelectValues::getTimeFormats</callback>
250 </pseudoconstant>
251 </field>
252 <field>
253 <name>note_columns</name>
254 <type>int unsigned</type>
255 <title>Field Note Columns</title>
256 <comment>Number of columns in Note Field</comment>
257 <add>1.4</add>
258 </field>
259 <field>
260 <name>note_rows</name>
261 <type>int unsigned</type>
262 <title>Field Note Rows</title>
263 <comment>Number of rows in Note Field</comment>
264 <add>1.4</add>
265 </field>
266 <field>
267 <name>column_name</name>
268 <type>varchar</type>
269 <title>Field Column Name</title>
270 <length>255</length>
271 <comment>Name of the column that holds the values for this field.</comment>
272 <add>2.0</add>
273 </field>
274 <field>
275 <name>option_group_id</name>
276 <type>int unsigned</type>
277 <title>Field Option Group ID</title>
278 <comment>For elements with options, the option group id that is used</comment>
279 <html>
280 <label>Field Option Group</label>
281 </html>
282 <add>1.4</add>
283 <pseudoconstant>
284 <table>civicrm_option_group</table>
285 <keyColumn>id</keyColumn>
286 <labelColumn>title</labelColumn>
287 </pseudoconstant>
288 </field>
289 <foreignKey>
290 <name>option_group_id</name>
291 <table>civicrm_option_group</table>
292 <key>id</key>
293 <add>5.6</add>
294 <onDelete>SET NULL</onDelete>
295 </foreignKey>
296 <field>
297 <name>serialize</name>
298 <type>int unsigned</type>
299 <title>Serialize</title>
300 <length>255</length>
301 <comment>Serialization method - a non-zero value indicates a multi-valued field.</comment>
302 <pseudoconstant>
303 <callback>CRM_Core_SelectValues::fieldSerialization</callback>
304 </pseudoconstant>
305 <add>5.27</add>
306 <required>true</required>
307 <default>0</default>
308 </field>
309 <field>
310 <name>filter</name>
311 <type>varchar</type>
312 <title>Field Filter</title>
313 <length>255</length>
314 <comment>Stores Contact Get API params contact reference custom fields. May be used for other filters in the future.</comment>
315 <add>4.1</add>
316 </field>
317 <field>
318 <name>in_selector</name>
319 <type>boolean</type>
320 <title>Field Display</title>
321 <default>0</default>
322 <comment>Should the multi-record custom field values be displayed in tab table listing</comment>
323 <add>4.5</add>
324 </field>
325 <index>
326 <name>UI_label_custom_group_id</name>
327 <fieldName>label</fieldName>
328 <fieldName>custom_group_id</fieldName>
329 <unique>true</unique>
330 <add>1.1</add>
331 </index>
332 <index>
333 <name>UI_name_custom_group_id</name>
334 <fieldName>name</fieldName>
335 <fieldName>custom_group_id</fieldName>
336 <unique>true</unique>
337 <add>4.3</add>
338 </index>
339 </table>