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