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