Merge pull request #10754 from totten/master-actcase-ts
[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>
9 <field>
29e8791c
EM
10 <name>id</name>
11 <uniqueName>activity_id</uniqueName>
12 <title>Activity ID</title>
13 <import>true</import>
14 <type>int unsigned</type>
15 <required>true</required>
16 <comment>Unique Other Activity ID</comment>
17 <add>1.1</add>
6a488035
TO
18 </field>
19 <primaryKey>
29e8791c
EM
20 <name>id</name>
21 <autoincrement>true</autoincrement>
6a488035
TO
22 </primaryKey>
23 <field>
29e8791c
EM
24 <name>source_contact_id</name>
25 <type>int unsigned</type>
26 <title>Source Contact</title>
27 <import>true</import>
28 <headerPattern>/(activity.)?source(.contact(.id)?)?/i</headerPattern>
29 <comment>Contact ID of the person scheduling or logging this Activity. Usually the authenticated user.</comment>
30 <add>1.1</add>
31 <drop>4.4</drop>
6a488035
TO
32 </field>
33 <foreignKey>
29e8791c
EM
34 <name>source_contact_id</name>
35 <table>civicrm_contact</table>
36 <key>id</key>
37 <add>1.1</add>
38 <drop>4.4</drop>
39 <onDelete>SET NULL</onDelete>
3f3a3ba0 40 </foreignKey>
6a488035 41 <index>
29e8791c
EM
42 <name>UI_source_contact_id</name>
43 <fieldName>source_contact_id</fieldName>
44 <add>2.0</add>
45 <drop>3.2</drop>
6a488035 46 </index>
6a488035 47 <field>
29e8791c
EM
48 <name>source_record_id</name>
49 <type>int unsigned</type>
50 <title>Source Record</title>
51 <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>
52 <add>2.0</add>
6a488035
TO
53 </field>
54 <index>
29e8791c
EM
55 <name>UI_source_record_id</name>
56 <fieldName>source_record_id</fieldName>
57 <add>3.2</add>
6a488035
TO
58 </index>
59 <field>
29e8791c 60 <name>activity_type_id</name>
9ab34172 61 <title>Activity Type ID</title>
29e8791c
EM
62 <import>true</import>
63 <type>int unsigned</type>
64 <required>true</required>
9ab34172 65 <export>true</export>
29e8791c
EM
66 <default>1</default>
67 <headerPattern>/(activity.)?type(.id$)/i</headerPattern>
68 <comment>FK to civicrm_option_value.id, that has to be valid, registered activity type.</comment>
69 <add>1.1</add>
70 <pseudoconstant>
71 <optionGroupName>activity_type</optionGroupName>
72 </pseudoconstant>
73 <html>
74 <type>Select</type>
75 </html>
6a488035
TO
76 </field>
77 <index>
29e8791c
EM
78 <name>UI_activity_type_id</name>
79 <fieldName>activity_type_id</fieldName>
80 <add>1.6</add>
6a488035 81 </index>
6a488035 82 <field>
29e8791c
EM
83 <name>target_entity_table</name>
84 <type>varchar</type>
85 <length>64</length>
86 <required>true</required>
87 <comment>Name of table where item being referenced is stored.</comment>
88 <add>1.1</add>
89 <drop>2.0</drop>
6a488035 90 </field>
6a488035 91 <field>
29e8791c
EM
92 <name>target_entity_id</name>
93 <type>int unsigned</type>
94 <required>true</required>
95 <comment>Foreign key to the referenced item.</comment>
96 <add>1.1</add>
97 <drop>2.0</drop>
6a488035 98 </field>
6a488035 99 <field>
29e8791c
EM
100 <name>subject</name>
101 <uniqueName>activity_subject</uniqueName>
102 <type>varchar</type>
103 <title>Subject</title>
104 <length>255</length>
105 <comment>The subject/purpose/short description of the activity.</comment>
106 <import>true</import>
107 <headerPattern>/(activity.)?subject/i</headerPattern>
108 <html>
109 <type>Text</type>
110 </html>
111 <add>1.1</add>
a8162657 112 <change>2.0</change>
6a488035 113 </field>
6a488035 114 <field>
29e8791c
EM
115 <name>scheduled_date</name>
116 <type>datetime</type>
117 <comment>Date and time meeting is scheduled to occur.</comment>
118 <add>1.1</add>
119 <drop>2.0</drop>
6a488035 120 </field>
6a488035 121 <field>
29e8791c
EM
122 <name>activity_date_time</name>
123 <import>true</import>
124 <title>Activity Date</title>
125 <type>datetime</type>
126 <headerPattern>/(activity.)?date(.time$)?/i</headerPattern>
127 <comment>Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.</comment>
128 <html>
129 <type>Select Date</type>
24317d89 130 <formatType>activityDateTime</formatType>
29e8791c
EM
131 </html>
132 <add>2.0</add>
3f3a3ba0 133 </field>
ab49600a
SL
134 <index>
135 <name>index_activity_date_time</name>
136 <fieldName>activity_date_time</fieldName>
137 <add>4.7</add>
138 </index>
6a488035 139 <field>
29e8791c
EM
140 <name>due_date_time</name>
141 <type>datetime</type>
142 <comment>Date and time this activity is due.</comment>
143 <add>2.0</add>
144 <drop>3.0</drop>
3f3a3ba0 145 </field>
6a488035 146 <field>
29e8791c
EM
147 <name>duration_hours</name>
148 <type>int unsigned</type>
149 <comment>Planned or actual duration of meeting - hours.</comment>
150 <add>1.1</add>
151 <drop>2.0</drop>
6a488035 152 </field>
6a488035 153 <field>
29e8791c
EM
154 <name>duration_minutes</name>
155 <type>int unsigned</type>
156 <comment>Planned or actual duration of meeting - minutes.</comment>
157 <add>1.1</add>
158 <drop>2.0</drop>
6a488035 159 </field>
6a488035 160 <field>
29e8791c
EM
161 <name>duration</name>
162 <uniqueName>activity_duration</uniqueName>
163 <title>Duration</title>
164 <import>true</import>
165 <type>int unsigned</type>
166 <headerPattern>/(activity.)?duration(s)?$/i</headerPattern>
167 <comment>Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.</comment>
168 <add>2.0</add>
169 <html>
170 <type>Text</type>
171 </html>
6a488035 172 </field>
6a488035 173 <field>
29e8791c
EM
174 <name>location</name>
175 <uniqueName>activity_location</uniqueName>
176 <title>Location</title>
177 <import>true</import>
178 <type>varchar</type>
179 <length>255</length>
180 <headerPattern>/(activity.)?location$/i</headerPattern>
181 <comment>Location of the activity (optional, open text).</comment>
182 <html>
183 <type>Text</type>
184 </html>
185 <add>1.1</add>
6a488035 186 </field>
6a488035 187 <field>
29e8791c
EM
188 <name>phone_id</name>
189 <type>int unsigned</type>
190 <title>Phone (called) ID</title>
191 <comment>Phone ID of the number called (optional - used if an existing phone number is selected).</comment>
192 <add>2.0</add>
193 <html>
916b6181 194 <type>EntityRef</type>
29e8791c 195 </html>
6a488035
TO
196 </field>
197 <foreignKey>
29e8791c
EM
198 <name>phone_id</name>
199 <table>civicrm_phone</table>
200 <key>id</key>
201 <add>2.0</add>
202 <onDelete>SET NULL</onDelete>
6a488035 203 </foreignKey>
6a488035 204 <field>
29e8791c
EM
205 <name>phone_number</name>
206 <title>Phone (called) Number</title>
207 <type>varchar</type>
208 <length>64</length>
209 <comment>Phone number in case the number does not exist in the civicrm_phone table.</comment>
210 <html>
211 <type>Text</type>
212 </html>
213 <add>2.0</add>
6a488035 214 </field>
6a488035 215 <field>
29e8791c
EM
216 <name>details</name>
217 <uniqueName>activity_details</uniqueName>
218 <title>Details</title>
219 <import>true</import>
07f093c3 220 <type>longtext</type>
29e8791c
EM
221 <headerPattern>/(activity.)?detail(s)?$/i</headerPattern>
222 <comment>Details about the activity (agenda, notes, etc).</comment>
223 <html>
224 <type>RichTextEditor</type>
225 <rows>8</rows>
226 <cols>60</cols>
227 </html>
228 <add>1.1</add>
6a488035 229 </field>
6a488035 230 <field>
29e8791c
EM
231 <name>status</name>
232 <type>enum</type>
233 <title>Status</title>
234 <values>Scheduled, Completed</values>
235 <comment>What is the status of this meeting? Completed meeting status results in activity history entry.</comment>
236 <add>1.1</add>
237 <drop>2.0</drop>
6a488035 238 </field>
6a488035 239 <field>
29e8791c
EM
240 <name>status_id</name>
241 <uniqueName>activity_status_id</uniqueName>
242 <title>Activity Status</title>
243 <import>true</import>
a0655ae9 244 <export>true</export>
29e8791c
EM
245 <headerPattern>/(activity.)?status(.label$)?/i</headerPattern>
246 <type>int unsigned</type>
247 <comment>ID of the status this activity is currently in. Foreign key to civicrm_option_value.</comment>
248 <add>2.0</add>
249 <pseudoconstant>
250 <optionGroupName>activity_status</optionGroupName>
251 </pseudoconstant>
252 <html>
253 <type>Select</type>
254 </html>
255 </field>
5b3543ce
JM
256 <index>
257 <name>index_status_id</name>
258 <fieldName>status_id</fieldName>
259 <add>4.7</add>
260 </index>
29e8791c
EM
261 <field>
262 <name>priority_id</name>
263 <type>int unsigned</type>
264 <title>Priority</title>
265 <comment>ID of the priority given to this activity. Foreign key to civicrm_option_value.</comment>
266 <add>2.0</add>
267 <pseudoconstant>
268 <optionGroupName>priority</optionGroupName>
269 </pseudoconstant>
270 <html>
271 <type>Select</type>
272 </html>
273 </field>
274 <field>
275 <name>parent_id</name>
276 <title>Parent Activity Id</title>
277 <type>int unsigned</type>
278 <comment>Parent meeting ID (if this is a follow-up item). This is not currently implemented</comment>
279 <add>1.1</add>
6a488035
TO
280 </field>
281 <foreignKey>
29e8791c
EM
282 <name>parent_id</name>
283 <table>civicrm_activity</table>
284 <key>id</key>
285 <add>1.1</add>
286 <onDelete>CASCADE</onDelete>
6a488035 287 </foreignKey>
6a488035 288 <field>
29e8791c
EM
289 <name>is_test</name>
290 <title>Test</title>
291 <uniqueName>activity_is_test</uniqueName>
292 <type>boolean</type>
293 <default>0</default>
294 <import>true</import>
295 <headerPattern>/(is.)?test(.activity)?/i</headerPattern>
296 <add>2.0</add>
297 <html>
298 <type>Select</type>
299 </html>
300 </field>
301 <field>
302 <name>medium_id</name>
303 <uniqueName>activity_medium_id</uniqueName>
304 <title>Activity Medium</title>
305 <type>int unsigned</type>
306 <default>NULL</default>
307 <comment>Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.</comment>
308 <pseudoconstant>
309 <optionGroupName>encounter_medium</optionGroupName>
310 </pseudoconstant>
311 <html>
312 <type>Select</type>
313 </html>
314 <add>2.2</add>
6a488035
TO
315 </field>
316 <index>
29e8791c
EM
317 <name>index_medium_id</name>
318 <fieldName>medium_id</fieldName>
319 <add>2.2</add>
6a488035
TO
320 </index>
321 <field>
29e8791c
EM
322 <name>is_auto</name>
323 <title>Auto</title>
324 <type>boolean</type>
325 <default>0</default>
326 <add>2.2</add>
3f3a3ba0
CW
327 </field>
328 <field>
29e8791c
EM
329 <name>relationship_id</name>
330 <title>Relationship Id</title>
331 <type>int unsigned</type>
332 <default>NULL</default>
333 <comment>FK to Relationship ID</comment>
334 <add>2.2</add>
6a488035 335 </field>
3f3a3ba0 336 <foreignKey>
29e8791c
EM
337 <name>relationship_id</name>
338 <table>civicrm_relationship</table>
339 <key>id</key>
340 <onDelete>SET NULL</onDelete>
3f3a3ba0 341 </foreignKey>
6a488035 342 <field>
29e8791c
EM
343 <name>is_current_revision</name>
344 <title>Is this activity a current revision in versioning chain?</title>
345 <type>boolean</type>
346 <default>1</default>
347 <import>true</import>
348 <headerPattern>/(is.)?(current.)?(revision|version(ing)?)/i</headerPattern>
349 <add>2.2</add>
350 <html>
351 <type>CheckBox</type>
352 </html>
6a488035
TO
353 </field>
354 <index>
29e8791c
EM
355 <name>index_is_current_revision</name>
356 <fieldName>is_current_revision</fieldName>
357 <add>2.2</add>
3f3a3ba0 358 </index>
6a488035 359 <field>
29e8791c
EM
360 <name>original_id</name>
361 <type>int unsigned</type>
362 <title>Original Activity ID </title>
363 <comment>Activity ID of the first activity record in versioning chain.</comment>
364 <add>2.2</add>
6a488035
TO
365 </field>
366 <foreignKey>
29e8791c
EM
367 <name>original_id</name>
368 <table>civicrm_activity</table>
369 <key>id</key>
370 <add>2.2</add>
371 <onDelete>CASCADE</onDelete>
6a488035
TO
372 </foreignKey>
373 <index>
29e8791c
EM
374 <name>UI_original_id</name>
375 <fieldName>original_id</fieldName>
376 <add>2.2</add>
377 <drop>3.2</drop>
3f3a3ba0 378 </index>
6a488035 379 <field>
29e8791c
EM
380 <name>result</name>
381 <uniqueName>activity_result</uniqueName>
382 <type>varchar</type>
383 <title>Result</title>
384 <length>255</length>
385 <comment>Currently being used to store result id for survey activity, FK to option value.</comment>
386 <html>
387 <type>Text</type>
388 </html>
389 <add>3.3</add>
390 </field>
391 <field>
392 <name>is_deleted</name>
393 <uniqueName>activity_is_deleted</uniqueName>
394 <title>Activity is in the Trash</title>
395 <type>boolean</type>
396 <default>0</default>
397 <import>true</import>
398 <headerPattern>/(activity.)?(trash|deleted)/i</headerPattern>
399 <add>2.2</add>
400 <html>
401 <type>Text</type>
402 </html>
6a488035
TO
403 </field>
404 <index>
29e8791c
EM
405 <name>index_is_deleted</name>
406 <fieldName>is_deleted</fieldName>
407 <add>2.2</add>
6a488035 408 </index>
3f3a3ba0 409 <field>
29e8791c
EM
410 <name>campaign_id</name>
411 <uniqueName>activity_campaign_id</uniqueName>
412 <type>int unsigned</type>
413 <title>Campaign</title>
414 <import>true</import>
415 <comment>The campaign for which this activity has been triggered.</comment>
416 <pseudoconstant>
417 <table>civicrm_campaign</table>
418 <keyColumn>id</keyColumn>
419 <labelColumn>title</labelColumn>
420 </pseudoconstant>
421 <add>3.4</add>
422 <html>
423 <type>CheckBox</type>
424 </html>
6a488035 425 </field>
3f3a3ba0 426 <foreignKey>
29e8791c
EM
427 <name>campaign_id</name>
428 <table>civicrm_campaign</table>
429 <key>id</key>
430 <onDelete>SET NULL</onDelete>
6a488035 431 </foreignKey>
3f3a3ba0 432 <field>
29e8791c
EM
433 <name>engagement_level</name>
434 <uniqueName>activity_engagement_level</uniqueName>
435 <type>int unsigned</type>
436 <title>Engagement Index</title>
437 <import>true</import>
438 <comment>Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.</comment>
439 <pseudoconstant>
440 <optionGroupName>engagement_index</optionGroupName>
441 </pseudoconstant>
442 <html>
443 <type>Select</type>
444 </html>
445 <add>3.4</add>
446 </field>
447 <field>
448 <name>weight</name>
7ecddde4 449 <title>Order</title>
29e8791c
EM
450 <type>int</type>
451 <add>4.1</add>
452 <html>
453 <type>Text</type>
454 </html>
6a488035 455 </field>
cd063b10
CW
456 <field>
457 <name>is_star</name>
458 <title>Is Starred</title>
459 <type>boolean</type>
460 <default>0</default>
461 <import>true</import>
462 <comment>Activity marked as favorite.</comment>
463 <headerPattern>/(activity.)?(star|favorite)/i</headerPattern>
464 <add>4.7</add>
465 </field>
3ed77291
TO
466 <field>
467 <name>created_date</name>
468 <uniqueName>activity_created_date</uniqueName>
469 <type>timestamp</type>
470 <comment>When was the activity was created.</comment>
471 <required>false</required>
472 <export>true</export>
473 <default>NULL</default>
474 <add>4.7</add>
475 </field>
476 <field>
477 <name>modified_date</name>
478 <uniqueName>activity_modified_date</uniqueName>
479 <type>timestamp</type>
480 <comment>When was the activity (or closely related entity) was created or modified or deleted.</comment>
481 <required>false</required>
482 <export>true</export>
483 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
484 <add>4.7</add>
485 </field>
6a488035 486</table>