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