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