Merge pull request #10025 from civicrm/JoeMurray-patch-1
[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 ID</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 <modify>2.0</modify>
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 <field>
135 <name>due_date_time</name>
136 <type>datetime</type>
137 <comment>Date and time this activity is due.</comment>
138 <add>2.0</add>
139 <drop>3.0</drop>
140 </field>
141 <field>
142 <name>duration_hours</name>
143 <type>int unsigned</type>
144 <comment>Planned or actual duration of meeting - hours.</comment>
145 <add>1.1</add>
146 <drop>2.0</drop>
147 </field>
148 <field>
149 <name>duration_minutes</name>
150 <type>int unsigned</type>
151 <comment>Planned or actual duration of meeting - minutes.</comment>
152 <add>1.1</add>
153 <drop>2.0</drop>
154 </field>
155 <field>
156 <name>duration</name>
157 <uniqueName>activity_duration</uniqueName>
158 <title>Duration</title>
159 <import>true</import>
160 <type>int unsigned</type>
161 <headerPattern>/(activity.)?duration(s)?$/i</headerPattern>
162 <comment>Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.</comment>
163 <add>2.0</add>
164 <html>
165 <type>Text</type>
166 </html>
167 </field>
168 <field>
169 <name>location</name>
170 <uniqueName>activity_location</uniqueName>
171 <title>Location</title>
172 <import>true</import>
173 <type>varchar</type>
174 <length>255</length>
175 <headerPattern>/(activity.)?location$/i</headerPattern>
176 <comment>Location of the activity (optional, open text).</comment>
177 <html>
178 <type>Text</type>
179 </html>
180 <add>1.1</add>
181 </field>
182 <field>
183 <name>phone_id</name>
184 <type>int unsigned</type>
185 <title>Phone (called) ID</title>
186 <comment>Phone ID of the number called (optional - used if an existing phone number is selected).</comment>
187 <add>2.0</add>
188 <html>
189 <type>EntityRef</type>
190 </html>
191 </field>
192 <foreignKey>
193 <name>phone_id</name>
194 <table>civicrm_phone</table>
195 <key>id</key>
196 <add>2.0</add>
197 <onDelete>SET NULL</onDelete>
198 </foreignKey>
199 <field>
200 <name>phone_number</name>
201 <title>Phone (called) Number</title>
202 <type>varchar</type>
203 <length>64</length>
204 <comment>Phone number in case the number does not exist in the civicrm_phone table.</comment>
205 <html>
206 <type>Text</type>
207 </html>
208 <add>2.0</add>
209 </field>
210 <field>
211 <name>details</name>
212 <uniqueName>activity_details</uniqueName>
213 <title>Details</title>
214 <import>true</import>
215 <type>longtext</type>
216 <headerPattern>/(activity.)?detail(s)?$/i</headerPattern>
217 <comment>Details about the activity (agenda, notes, etc).</comment>
218 <html>
219 <type>RichTextEditor</type>
220 <rows>8</rows>
221 <cols>60</cols>
222 </html>
223 <add>1.1</add>
224 </field>
225 <field>
226 <name>status</name>
227 <type>enum</type>
228 <title>Status</title>
229 <values>Scheduled, Completed</values>
230 <comment>What is the status of this meeting? Completed meeting status results in activity history entry.</comment>
231 <add>1.1</add>
232 <drop>2.0</drop>
233 </field>
234 <field>
235 <name>status_id</name>
236 <uniqueName>activity_status_id</uniqueName>
237 <title>Activity Status</title>
238 <import>true</import>
239 <export>false</export>
240 <headerPattern>/(activity.)?status(.label$)?/i</headerPattern>
241 <type>int unsigned</type>
242 <comment>ID of the status this activity is currently in. Foreign key to civicrm_option_value.</comment>
243 <add>2.0</add>
244 <pseudoconstant>
245 <optionGroupName>activity_status</optionGroupName>
246 </pseudoconstant>
247 <html>
248 <type>Select</type>
249 </html>
250 </field>
251 <field>
252 <name>priority_id</name>
253 <type>int unsigned</type>
254 <title>Priority</title>
255 <comment>ID of the priority given to this activity. Foreign key to civicrm_option_value.</comment>
256 <add>2.0</add>
257 <pseudoconstant>
258 <optionGroupName>priority</optionGroupName>
259 </pseudoconstant>
260 <html>
261 <type>Select</type>
262 </html>
263 </field>
264 <field>
265 <name>parent_id</name>
266 <title>Parent Activity Id</title>
267 <type>int unsigned</type>
268 <comment>Parent meeting ID (if this is a follow-up item). This is not currently implemented</comment>
269 <add>1.1</add>
270 </field>
271 <foreignKey>
272 <name>parent_id</name>
273 <table>civicrm_activity</table>
274 <key>id</key>
275 <add>1.1</add>
276 <onDelete>CASCADE</onDelete>
277 </foreignKey>
278 <field>
279 <name>is_test</name>
280 <title>Test</title>
281 <uniqueName>activity_is_test</uniqueName>
282 <type>boolean</type>
283 <default>0</default>
284 <import>true</import>
285 <headerPattern>/(is.)?test(.activity)?/i</headerPattern>
286 <add>2.0</add>
287 <html>
288 <type>Select</type>
289 </html>
290 </field>
291 <field>
292 <name>medium_id</name>
293 <uniqueName>activity_medium_id</uniqueName>
294 <title>Activity Medium</title>
295 <type>int unsigned</type>
296 <default>NULL</default>
297 <comment>Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.</comment>
298 <pseudoconstant>
299 <optionGroupName>encounter_medium</optionGroupName>
300 </pseudoconstant>
301 <html>
302 <type>Select</type>
303 </html>
304 <add>2.2</add>
305 </field>
306 <index>
307 <name>index_medium_id</name>
308 <fieldName>medium_id</fieldName>
309 <add>2.2</add>
310 </index>
311 <field>
312 <name>is_auto</name>
313 <title>Auto</title>
314 <type>boolean</type>
315 <default>0</default>
316 <add>2.2</add>
317 </field>
318 <field>
319 <name>relationship_id</name>
320 <title>Relationship Id</title>
321 <type>int unsigned</type>
322 <default>NULL</default>
323 <comment>FK to Relationship ID</comment>
324 <add>2.2</add>
325 </field>
326 <foreignKey>
327 <name>relationship_id</name>
328 <table>civicrm_relationship</table>
329 <key>id</key>
330 <onDelete>SET NULL</onDelete>
331 </foreignKey>
332 <field>
333 <name>is_current_revision</name>
334 <title>Is this activity a current revision in versioning chain?</title>
335 <type>boolean</type>
336 <default>1</default>
337 <import>true</import>
338 <headerPattern>/(is.)?(current.)?(revision|version(ing)?)/i</headerPattern>
339 <add>2.2</add>
340 <html>
341 <type>CheckBox</type>
342 </html>
343 </field>
344 <index>
345 <name>index_is_current_revision</name>
346 <fieldName>is_current_revision</fieldName>
347 <add>2.2</add>
348 </index>
349 <field>
350 <name>original_id</name>
351 <type>int unsigned</type>
352 <title>Original Activity ID </title>
353 <comment>Activity ID of the first activity record in versioning chain.</comment>
354 <add>2.2</add>
355 </field>
356 <foreignKey>
357 <name>original_id</name>
358 <table>civicrm_activity</table>
359 <key>id</key>
360 <add>2.2</add>
361 <onDelete>CASCADE</onDelete>
362 </foreignKey>
363 <index>
364 <name>UI_original_id</name>
365 <fieldName>original_id</fieldName>
366 <add>2.2</add>
367 <drop>3.2</drop>
368 </index>
369 <field>
370 <name>result</name>
371 <uniqueName>activity_result</uniqueName>
372 <type>varchar</type>
373 <title>Result</title>
374 <length>255</length>
375 <comment>Currently being used to store result id for survey activity, FK to option value.</comment>
376 <html>
377 <type>Text</type>
378 </html>
379 <add>3.3</add>
380 </field>
381 <field>
382 <name>is_deleted</name>
383 <uniqueName>activity_is_deleted</uniqueName>
384 <title>Activity is in the Trash</title>
385 <type>boolean</type>
386 <default>0</default>
387 <import>true</import>
388 <headerPattern>/(activity.)?(trash|deleted)/i</headerPattern>
389 <add>2.2</add>
390 <html>
391 <type>Text</type>
392 </html>
393 </field>
394 <index>
395 <name>index_is_deleted</name>
396 <fieldName>is_deleted</fieldName>
397 <add>2.2</add>
398 </index>
399 <field>
400 <name>campaign_id</name>
401 <uniqueName>activity_campaign_id</uniqueName>
402 <type>int unsigned</type>
403 <title>Campaign</title>
404 <import>true</import>
405 <comment>The campaign for which this activity has been triggered.</comment>
406 <pseudoconstant>
407 <table>civicrm_campaign</table>
408 <keyColumn>id</keyColumn>
409 <labelColumn>title</labelColumn>
410 </pseudoconstant>
411 <add>3.4</add>
412 <html>
413 <type>CheckBox</type>
414 </html>
415 </field>
416 <foreignKey>
417 <name>campaign_id</name>
418 <table>civicrm_campaign</table>
419 <key>id</key>
420 <onDelete>SET NULL</onDelete>
421 </foreignKey>
422 <field>
423 <name>engagement_level</name>
424 <uniqueName>activity_engagement_level</uniqueName>
425 <type>int unsigned</type>
426 <title>Engagement Index</title>
427 <import>true</import>
428 <comment>Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.</comment>
429 <pseudoconstant>
430 <optionGroupName>engagement_index</optionGroupName>
431 </pseudoconstant>
432 <html>
433 <type>Select</type>
434 </html>
435 <add>3.4</add>
436 </field>
437 <field>
438 <name>weight</name>
439 <title>Order</title>
440 <type>int</type>
441 <add>4.1</add>
442 <html>
443 <type>Text</type>
444 </html>
445 </field>
446 <field>
447 <name>is_star</name>
448 <title>Is Starred</title>
449 <type>boolean</type>
450 <default>0</default>
451 <import>true</import>
452 <comment>Activity marked as favorite.</comment>
453 <headerPattern>/(activity.)?(star|favorite)/i</headerPattern>
454 <add>4.7</add>
455 </field>
456 </table>