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