Add "labelField" metadata to entities
[civicrm-core.git] / xml / schema / Activity / Activity.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2<table>
3 <base>CRM/Activity</base>
4 <class>Activity</class>
5 <name>civicrm_activity</name>
165a7fc0 6 <comment>Other Activity details stored here include contact, location, details.</comment>
6a488035
TO
7 <add>1.1</add>
8 <log>true</log>
449c4e6b 9 <icon>fa-tasks</icon>
8ab43c93 10 <labelField>subject</labelField>
a7bd99ff 11 <paths>
5c385299 12 <add>civicrm/activity?reset=1&amp;action=add&amp;context=standalone</add>
a7bd99ff 13 <view>civicrm/activity?reset=1&amp;action=view&amp;id=[id]</view>
5c385299 14 <update>civicrm/activity/add?reset=1&amp;action=update&amp;id=[id]</update>
a7bd99ff
CW
15 <delete>civicrm/activity?reset=1&amp;action=delete&amp;id=[id]</delete>
16 </paths>
6a488035 17 <field>
29e8791c
EM
18 <name>id</name>
19 <uniqueName>activity_id</uniqueName>
20 <title>Activity ID</title>
21 <import>true</import>
22 <type>int unsigned</type>
23 <required>true</required>
24 <comment>Unique Other Activity ID</comment>
25 <add>1.1</add>
6a488035
TO
26 </field>
27 <primaryKey>
29e8791c
EM
28 <name>id</name>
29 <autoincrement>true</autoincrement>
6a488035 30 </primaryKey>
6a488035 31 <field>
29e8791c
EM
32 <name>source_record_id</name>
33 <type>int unsigned</type>
34 <title>Source Record</title>
35 <comment>Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.</comment>
36 <add>2.0</add>
6a488035
TO
37 </field>
38 <index>
29e8791c
EM
39 <name>UI_source_record_id</name>
40 <fieldName>source_record_id</fieldName>
41 <add>3.2</add>
6a488035
TO
42 </index>
43 <field>
29e8791c 44 <name>activity_type_id</name>
a1d226d6 45 <title>Activity Type ID</title>
29e8791c
EM
46 <import>true</import>
47 <type>int unsigned</type>
48 <required>true</required>
9ab34172 49 <export>true</export>
29e8791c
EM
50 <default>1</default>
51 <headerPattern>/(activity.)?type(.id$)/i</headerPattern>
52 <comment>FK to civicrm_option_value.id, that has to be valid, registered activity type.</comment>
53 <add>1.1</add>
54 <pseudoconstant>
55 <optionGroupName>activity_type</optionGroupName>
56 </pseudoconstant>
57 <html>
58 <type>Select</type>
a1d226d6 59 <label>Activity Type</label>
29e8791c 60 </html>
6a488035
TO
61 </field>
62 <index>
29e8791c
EM
63 <name>UI_activity_type_id</name>
64 <fieldName>activity_type_id</fieldName>
65 <add>1.6</add>
6a488035 66 </index>
6a488035 67 <field>
29e8791c
EM
68 <name>subject</name>
69 <uniqueName>activity_subject</uniqueName>
70 <type>varchar</type>
71 <title>Subject</title>
72 <length>255</length>
73 <comment>The subject/purpose/short description of the activity.</comment>
74 <import>true</import>
75 <headerPattern>/(activity.)?subject/i</headerPattern>
76 <html>
77 <type>Text</type>
78 </html>
79 <add>1.1</add>
a8162657 80 <change>2.0</change>
6a488035 81 </field>
6a488035 82 <field>
29e8791c
EM
83 <name>activity_date_time</name>
84 <import>true</import>
487813ab
MW
85 <required>false</required>
86 <export>true</export>
87 <default>CURRENT_TIMESTAMP</default>
29e8791c
EM
88 <title>Activity Date</title>
89 <type>datetime</type>
90 <headerPattern>/(activity.)?date(.time$)?/i</headerPattern>
91 <comment>Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.</comment>
92 <html>
93 <type>Select Date</type>
24317d89 94 <formatType>activityDateTime</formatType>
29e8791c
EM
95 </html>
96 <add>2.0</add>
3f3a3ba0 97 </field>
ab49600a
SL
98 <index>
99 <name>index_activity_date_time</name>
100 <fieldName>activity_date_time</fieldName>
101 <add>4.7</add>
102 </index>
6a488035 103 <field>
29e8791c
EM
104 <name>duration</name>
105 <uniqueName>activity_duration</uniqueName>
106 <title>Duration</title>
107 <import>true</import>
108 <type>int unsigned</type>
109 <headerPattern>/(activity.)?duration(s)?$/i</headerPattern>
110 <comment>Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.</comment>
111 <add>2.0</add>
112 <html>
3542118f 113 <type>Number</type>
29e8791c 114 </html>
6a488035 115 </field>
6a488035 116 <field>
29e8791c
EM
117 <name>location</name>
118 <uniqueName>activity_location</uniqueName>
119 <title>Location</title>
120 <import>true</import>
121 <type>varchar</type>
122 <length>255</length>
123 <headerPattern>/(activity.)?location$/i</headerPattern>
124 <comment>Location of the activity (optional, open text).</comment>
125 <html>
126 <type>Text</type>
127 </html>
128 <add>1.1</add>
6a488035 129 </field>
6a488035 130 <field>
29e8791c
EM
131 <name>phone_id</name>
132 <type>int unsigned</type>
a1d226d6 133 <title>Phone (called) ID</title>
29e8791c
EM
134 <comment>Phone ID of the number called (optional - used if an existing phone number is selected).</comment>
135 <add>2.0</add>
136 <html>
916b6181 137 <type>EntityRef</type>
a1d226d6 138 <label>Phone (called)</label>
29e8791c 139 </html>
6a488035
TO
140 </field>
141 <foreignKey>
29e8791c
EM
142 <name>phone_id</name>
143 <table>civicrm_phone</table>
144 <key>id</key>
145 <add>2.0</add>
146 <onDelete>SET NULL</onDelete>
6a488035 147 </foreignKey>
6a488035 148 <field>
29e8791c
EM
149 <name>phone_number</name>
150 <title>Phone (called) Number</title>
151 <type>varchar</type>
152 <length>64</length>
153 <comment>Phone number in case the number does not exist in the civicrm_phone table.</comment>
154 <html>
155 <type>Text</type>
156 </html>
157 <add>2.0</add>
6a488035 158 </field>
6a488035 159 <field>
29e8791c
EM
160 <name>details</name>
161 <uniqueName>activity_details</uniqueName>
162 <title>Details</title>
163 <import>true</import>
07f093c3 164 <type>longtext</type>
29e8791c
EM
165 <headerPattern>/(activity.)?detail(s)?$/i</headerPattern>
166 <comment>Details about the activity (agenda, notes, etc).</comment>
167 <html>
168 <type>RichTextEditor</type>
169 <rows>8</rows>
170 <cols>60</cols>
171 </html>
172 <add>1.1</add>
6a488035 173 </field>
6a488035 174 <field>
29e8791c
EM
175 <name>status_id</name>
176 <uniqueName>activity_status_id</uniqueName>
177 <title>Activity Status</title>
178 <import>true</import>
a0655ae9 179 <export>true</export>
29e8791c
EM
180 <headerPattern>/(activity.)?status(.label$)?/i</headerPattern>
181 <type>int unsigned</type>
182 <comment>ID of the status this activity is currently in. Foreign key to civicrm_option_value.</comment>
183 <add>2.0</add>
184 <pseudoconstant>
185 <optionGroupName>activity_status</optionGroupName>
186 </pseudoconstant>
187 <html>
188 <type>Select</type>
189 </html>
190 </field>
5b3543ce
JM
191 <index>
192 <name>index_status_id</name>
193 <fieldName>status_id</fieldName>
194 <add>4.7</add>
195 </index>
29e8791c
EM
196 <field>
197 <name>priority_id</name>
198 <type>int unsigned</type>
199 <title>Priority</title>
6c0c4ac7 200 <export>true</export>
201 <import>true</import>
29e8791c
EM
202 <comment>ID of the priority given to this activity. Foreign key to civicrm_option_value.</comment>
203 <add>2.0</add>
204 <pseudoconstant>
205 <optionGroupName>priority</optionGroupName>
206 </pseudoconstant>
207 <html>
208 <type>Select</type>
209 </html>
210 </field>
211 <field>
212 <name>parent_id</name>
213 <title>Parent Activity Id</title>
214 <type>int unsigned</type>
215 <comment>Parent meeting ID (if this is a follow-up item). This is not currently implemented</comment>
216 <add>1.1</add>
6a488035
TO
217 </field>
218 <foreignKey>
29e8791c
EM
219 <name>parent_id</name>
220 <table>civicrm_activity</table>
221 <key>id</key>
222 <add>1.1</add>
223 <onDelete>CASCADE</onDelete>
6a488035 224 </foreignKey>
6a488035 225 <field>
29e8791c
EM
226 <name>is_test</name>
227 <title>Test</title>
228 <uniqueName>activity_is_test</uniqueName>
229 <type>boolean</type>
230 <default>0</default>
231 <import>true</import>
232 <headerPattern>/(is.)?test(.activity)?/i</headerPattern>
233 <add>2.0</add>
234 <html>
3542118f 235 <type>CheckBox</type>
29e8791c
EM
236 </html>
237 </field>
238 <field>
239 <name>medium_id</name>
240 <uniqueName>activity_medium_id</uniqueName>
241 <title>Activity Medium</title>
242 <type>int unsigned</type>
243 <default>NULL</default>
244 <comment>Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.</comment>
245 <pseudoconstant>
246 <optionGroupName>encounter_medium</optionGroupName>
247 </pseudoconstant>
248 <html>
249 <type>Select</type>
250 </html>
251 <add>2.2</add>
6a488035
TO
252 </field>
253 <index>
29e8791c
EM
254 <name>index_medium_id</name>
255 <fieldName>medium_id</fieldName>
256 <add>2.2</add>
9bfe43ee 257 <drop>5.28</drop>
6a488035
TO
258 </index>
259 <field>
29e8791c
EM
260 <name>is_auto</name>
261 <title>Auto</title>
262 <type>boolean</type>
263 <default>0</default>
264 <add>2.2</add>
3f3a3ba0
CW
265 </field>
266 <field>
29e8791c
EM
267 <name>relationship_id</name>
268 <title>Relationship Id</title>
269 <type>int unsigned</type>
270 <default>NULL</default>
271 <comment>FK to Relationship ID</comment>
272 <add>2.2</add>
6a488035 273 </field>
3f3a3ba0 274 <foreignKey>
29e8791c
EM
275 <name>relationship_id</name>
276 <table>civicrm_relationship</table>
277 <key>id</key>
278 <onDelete>SET NULL</onDelete>
3f3a3ba0 279 </foreignKey>
6a488035 280 <field>
29e8791c
EM
281 <name>is_current_revision</name>
282 <title>Is this activity a current revision in versioning chain?</title>
283 <type>boolean</type>
284 <default>1</default>
285 <import>true</import>
286 <headerPattern>/(is.)?(current.)?(revision|version(ing)?)/i</headerPattern>
287 <add>2.2</add>
6a488035
TO
288 </field>
289 <index>
29e8791c
EM
290 <name>index_is_current_revision</name>
291 <fieldName>is_current_revision</fieldName>
292 <add>2.2</add>
3f3a3ba0 293 </index>
6a488035 294 <field>
29e8791c
EM
295 <name>original_id</name>
296 <type>int unsigned</type>
297 <title>Original Activity ID </title>
298 <comment>Activity ID of the first activity record in versioning chain.</comment>
299 <add>2.2</add>
6a488035
TO
300 </field>
301 <foreignKey>
29e8791c
EM
302 <name>original_id</name>
303 <table>civicrm_activity</table>
304 <key>id</key>
305 <add>2.2</add>
306 <onDelete>CASCADE</onDelete>
6a488035 307 </foreignKey>
6a488035 308 <field>
29e8791c
EM
309 <name>result</name>
310 <uniqueName>activity_result</uniqueName>
311 <type>varchar</type>
312 <title>Result</title>
313 <length>255</length>
314 <comment>Currently being used to store result id for survey activity, FK to option value.</comment>
29e8791c
EM
315 <add>3.3</add>
316 </field>
317 <field>
318 <name>is_deleted</name>
319 <uniqueName>activity_is_deleted</uniqueName>
320 <title>Activity is in the Trash</title>
321 <type>boolean</type>
322 <default>0</default>
323 <import>true</import>
324 <headerPattern>/(activity.)?(trash|deleted)/i</headerPattern>
325 <add>2.2</add>
326 <html>
3542118f 327 <type>CheckBox</type>
29e8791c 328 </html>
6a488035
TO
329 </field>
330 <index>
29e8791c
EM
331 <name>index_is_deleted</name>
332 <fieldName>is_deleted</fieldName>
333 <add>2.2</add>
6a488035 334 </index>
3f3a3ba0 335 <field>
29e8791c
EM
336 <name>campaign_id</name>
337 <uniqueName>activity_campaign_id</uniqueName>
338 <type>int unsigned</type>
339 <title>Campaign</title>
340 <import>true</import>
341 <comment>The campaign for which this activity has been triggered.</comment>
342 <pseudoconstant>
343 <table>civicrm_campaign</table>
344 <keyColumn>id</keyColumn>
345 <labelColumn>title</labelColumn>
346 </pseudoconstant>
347 <add>3.4</add>
348 <html>
3542118f 349 <type>Select</type>
29e8791c 350 </html>
6a488035 351 </field>
3f3a3ba0 352 <foreignKey>
29e8791c
EM
353 <name>campaign_id</name>
354 <table>civicrm_campaign</table>
355 <key>id</key>
356 <onDelete>SET NULL</onDelete>
6a488035 357 </foreignKey>
3f3a3ba0 358 <field>
29e8791c
EM
359 <name>engagement_level</name>
360 <uniqueName>activity_engagement_level</uniqueName>
361 <type>int unsigned</type>
362 <title>Engagement Index</title>
363 <import>true</import>
364 <comment>Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.</comment>
365 <pseudoconstant>
366 <optionGroupName>engagement_index</optionGroupName>
367 </pseudoconstant>
368 <html>
369 <type>Select</type>
370 </html>
371 <add>3.4</add>
372 </field>
373 <field>
374 <name>weight</name>
7ecddde4 375 <title>Order</title>
29e8791c
EM
376 <type>int</type>
377 <add>4.1</add>
6a488035 378 </field>
cd063b10
CW
379 <field>
380 <name>is_star</name>
381 <title>Is Starred</title>
382 <type>boolean</type>
383 <default>0</default>
384 <import>true</import>
385 <comment>Activity marked as favorite.</comment>
386 <headerPattern>/(activity.)?(star|favorite)/i</headerPattern>
387 <add>4.7</add>
3542118f
CW
388 <html>
389 <type>Checkbox</type>
390 </html>
cd063b10 391 </field>
3ed77291
TO
392 <field>
393 <name>created_date</name>
394 <uniqueName>activity_created_date</uniqueName>
395 <type>timestamp</type>
396 <comment>When was the activity was created.</comment>
397 <required>false</required>
398 <export>true</export>
487813ab 399 <default>CURRENT_TIMESTAMP</default>
3ed77291
TO
400 <add>4.7</add>
401 </field>
402 <field>
403 <name>modified_date</name>
404 <uniqueName>activity_modified_date</uniqueName>
405 <type>timestamp</type>
406 <comment>When was the activity (or closely related entity) was created or modified or deleted.</comment>
407 <required>false</required>
408 <export>true</export>
409 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
410 <add>4.7</add>
411 </field>
6a488035 412</table>