Merge pull request #15390 from kewljuice/patch-4
[civicrm-core.git] / xml / schema / Activity / Activity.xml
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>
6 <comment>Other Activity details stored here include contact, location, details.</comment>
7 <add>1.1</add>
8 <log>true</log>
9 <field>
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>
18 </field>
19 <primaryKey>
20 <name>id</name>
21 <autoincrement>true</autoincrement>
22 </primaryKey>
23 <field>
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>
32 </field>
33 <foreignKey>
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>
40 </foreignKey>
41 <index>
42 <name>UI_source_contact_id</name>
43 <fieldName>source_contact_id</fieldName>
44 <add>2.0</add>
45 <drop>3.2</drop>
46 </index>
47 <field>
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>
53 </field>
54 <index>
55 <name>UI_source_record_id</name>
56 <fieldName>source_record_id</fieldName>
57 <add>3.2</add>
58 </index>
59 <field>
60 <name>activity_type_id</name>
61 <title>Activity Type</title>
62 <import>true</import>
63 <type>int unsigned</type>
64 <required>true</required>
65 <export>true</export>
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>
76 </field>
77 <index>
78 <name>UI_activity_type_id</name>
79 <fieldName>activity_type_id</fieldName>
80 <add>1.6</add>
81 </index>
82 <field>
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>
90 </field>
91 <field>
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>
98 </field>
99 <field>
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>
112 <change>2.0</change>
113 </field>
114 <field>
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>
120 </field>
121 <field>
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>
130 <formatType>activityDateTime</formatType>
131 </html>
132 <add>2.0</add>
133 </field>
134 <index>
135 <name>index_activity_date_time</name>
136 <fieldName>activity_date_time</fieldName>
137 <add>4.7</add>
138 </index>
139 <field>
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>
145 </field>
146 <field>
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>
152 </field>
153 <field>
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>
159 </field>
160 <field>
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>Number</type>
171 </html>
172 </field>
173 <field>
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>
186 </field>
187 <field>
188 <name>phone_id</name>
189 <type>int unsigned</type>
190 <title>Phone (called)</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>
194 <type>EntityRef</type>
195 </html>
196 </field>
197 <foreignKey>
198 <name>phone_id</name>
199 <table>civicrm_phone</table>
200 <key>id</key>
201 <add>2.0</add>
202 <onDelete>SET NULL</onDelete>
203 </foreignKey>
204 <field>
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>
214 </field>
215 <field>
216 <name>details</name>
217 <uniqueName>activity_details</uniqueName>
218 <title>Details</title>
219 <import>true</import>
220 <type>longtext</type>
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>
229 </field>
230 <field>
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>
238 </field>
239 <field>
240 <name>status_id</name>
241 <uniqueName>activity_status_id</uniqueName>
242 <title>Activity Status</title>
243 <import>true</import>
244 <export>true</export>
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>
256 <index>
257 <name>index_status_id</name>
258 <fieldName>status_id</fieldName>
259 <add>4.7</add>
260 </index>
261 <field>
262 <name>priority_id</name>
263 <type>int unsigned</type>
264 <title>Priority</title>
265 <export>true</export>
266 <import>true</import>
267 <comment>ID of the priority given to this activity. Foreign key to civicrm_option_value.</comment>
268 <add>2.0</add>
269 <pseudoconstant>
270 <optionGroupName>priority</optionGroupName>
271 </pseudoconstant>
272 <html>
273 <type>Select</type>
274 </html>
275 </field>
276 <field>
277 <name>parent_id</name>
278 <title>Parent Activity Id</title>
279 <type>int unsigned</type>
280 <comment>Parent meeting ID (if this is a follow-up item). This is not currently implemented</comment>
281 <add>1.1</add>
282 </field>
283 <foreignKey>
284 <name>parent_id</name>
285 <table>civicrm_activity</table>
286 <key>id</key>
287 <add>1.1</add>
288 <onDelete>CASCADE</onDelete>
289 </foreignKey>
290 <field>
291 <name>is_test</name>
292 <title>Test</title>
293 <uniqueName>activity_is_test</uniqueName>
294 <type>boolean</type>
295 <default>0</default>
296 <import>true</import>
297 <headerPattern>/(is.)?test(.activity)?/i</headerPattern>
298 <add>2.0</add>
299 <html>
300 <type>CheckBox</type>
301 </html>
302 </field>
303 <field>
304 <name>medium_id</name>
305 <uniqueName>activity_medium_id</uniqueName>
306 <title>Activity Medium</title>
307 <type>int unsigned</type>
308 <default>NULL</default>
309 <comment>Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.</comment>
310 <pseudoconstant>
311 <optionGroupName>encounter_medium</optionGroupName>
312 </pseudoconstant>
313 <html>
314 <type>Select</type>
315 </html>
316 <add>2.2</add>
317 </field>
318 <index>
319 <name>index_medium_id</name>
320 <fieldName>medium_id</fieldName>
321 <add>2.2</add>
322 </index>
323 <field>
324 <name>is_auto</name>
325 <title>Auto</title>
326 <type>boolean</type>
327 <default>0</default>
328 <add>2.2</add>
329 </field>
330 <field>
331 <name>relationship_id</name>
332 <title>Relationship Id</title>
333 <type>int unsigned</type>
334 <default>NULL</default>
335 <comment>FK to Relationship ID</comment>
336 <add>2.2</add>
337 </field>
338 <foreignKey>
339 <name>relationship_id</name>
340 <table>civicrm_relationship</table>
341 <key>id</key>
342 <onDelete>SET NULL</onDelete>
343 </foreignKey>
344 <field>
345 <name>is_current_revision</name>
346 <title>Is this activity a current revision in versioning chain?</title>
347 <type>boolean</type>
348 <default>1</default>
349 <import>true</import>
350 <headerPattern>/(is.)?(current.)?(revision|version(ing)?)/i</headerPattern>
351 <add>2.2</add>
352 </field>
353 <index>
354 <name>index_is_current_revision</name>
355 <fieldName>is_current_revision</fieldName>
356 <add>2.2</add>
357 </index>
358 <field>
359 <name>original_id</name>
360 <type>int unsigned</type>
361 <title>Original Activity ID </title>
362 <comment>Activity ID of the first activity record in versioning chain.</comment>
363 <add>2.2</add>
364 </field>
365 <foreignKey>
366 <name>original_id</name>
367 <table>civicrm_activity</table>
368 <key>id</key>
369 <add>2.2</add>
370 <onDelete>CASCADE</onDelete>
371 </foreignKey>
372 <index>
373 <name>UI_original_id</name>
374 <fieldName>original_id</fieldName>
375 <add>2.2</add>
376 <drop>3.2</drop>
377 </index>
378 <field>
379 <name>result</name>
380 <uniqueName>activity_result</uniqueName>
381 <type>varchar</type>
382 <title>Result</title>
383 <length>255</length>
384 <comment>Currently being used to store result id for survey activity, FK to option value.</comment>
385 <add>3.3</add>
386 </field>
387 <field>
388 <name>is_deleted</name>
389 <uniqueName>activity_is_deleted</uniqueName>
390 <title>Activity is in the Trash</title>
391 <type>boolean</type>
392 <default>0</default>
393 <import>true</import>
394 <headerPattern>/(activity.)?(trash|deleted)/i</headerPattern>
395 <add>2.2</add>
396 <html>
397 <type>CheckBox</type>
398 </html>
399 </field>
400 <index>
401 <name>index_is_deleted</name>
402 <fieldName>is_deleted</fieldName>
403 <add>2.2</add>
404 </index>
405 <field>
406 <name>campaign_id</name>
407 <uniqueName>activity_campaign_id</uniqueName>
408 <type>int unsigned</type>
409 <title>Campaign</title>
410 <import>true</import>
411 <comment>The campaign for which this activity has been triggered.</comment>
412 <pseudoconstant>
413 <table>civicrm_campaign</table>
414 <keyColumn>id</keyColumn>
415 <labelColumn>title</labelColumn>
416 </pseudoconstant>
417 <add>3.4</add>
418 <html>
419 <type>Select</type>
420 </html>
421 </field>
422 <foreignKey>
423 <name>campaign_id</name>
424 <table>civicrm_campaign</table>
425 <key>id</key>
426 <onDelete>SET NULL</onDelete>
427 </foreignKey>
428 <field>
429 <name>engagement_level</name>
430 <uniqueName>activity_engagement_level</uniqueName>
431 <type>int unsigned</type>
432 <title>Engagement Index</title>
433 <import>true</import>
434 <comment>Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.</comment>
435 <pseudoconstant>
436 <optionGroupName>engagement_index</optionGroupName>
437 </pseudoconstant>
438 <html>
439 <type>Select</type>
440 </html>
441 <add>3.4</add>
442 </field>
443 <field>
444 <name>weight</name>
445 <title>Order</title>
446 <type>int</type>
447 <add>4.1</add>
448 </field>
449 <field>
450 <name>is_star</name>
451 <title>Is Starred</title>
452 <type>boolean</type>
453 <default>0</default>
454 <import>true</import>
455 <comment>Activity marked as favorite.</comment>
456 <headerPattern>/(activity.)?(star|favorite)/i</headerPattern>
457 <add>4.7</add>
458 <html>
459 <type>Checkbox</type>
460 </html>
461 </field>
462 <field>
463 <name>created_date</name>
464 <uniqueName>activity_created_date</uniqueName>
465 <type>timestamp</type>
466 <comment>When was the activity was created.</comment>
467 <required>false</required>
468 <export>true</export>
469 <default>NULL</default>
470 <add>4.7</add>
471 </field>
472 <field>
473 <name>modified_date</name>
474 <uniqueName>activity_modified_date</uniqueName>
475 <type>timestamp</type>
476 <comment>When was the activity (or closely related entity) was created or modified or deleted.</comment>
477 <required>false</required>
478 <export>true</export>
479 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
480 <add>4.7</add>
481 </field>
482 </table>