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