Merge pull request #22154 from eileenmcnaughton/n3
[civicrm-core.git] / xml / schema / Campaign / Campaign.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2 <table>
3 <base>CRM/Campaign</base>
4 <class>Campaign</class>
5 <name>civicrm_campaign</name>
6 <comment>Campaign Details.</comment>
7 <description>Campaigns link activities, contributions, mailings, etc. that share a programmatic goal.</description>
8 <add>3.3</add>
9 <icon>fa-bullhorn</icon>
10 <labelField>title</labelField>
11 <component>CiviCampaign</component>
12 <paths>
13 <add>civicrm/campaign/add?reset=1</add>
14 <update>civicrm/campaign/add?reset=1&amp;action=update&amp;id=[id]</update>
15 <delete>civicrm/campaign/add?reset=1&amp;action=delete&amp;id=[id]</delete>
16 </paths>
17 <field>
18 <name>id</name>
19 <title>Campaign ID</title>
20 <type>int unsigned</type>
21 <required>true</required>
22 <comment>Unique Campaign ID.</comment>
23 <import>true</import>
24 <html>
25 <type>Number</type>
26 </html>
27 <add>3.3</add>
28 </field>
29 <primaryKey>
30 <name>id</name>
31 <autoincrement>true</autoincrement>
32 </primaryKey>
33
34 <field>
35 <name>name</name>
36 <title>Campaign Name</title>
37 <type>varchar</type>
38 <length>255</length>
39 <required>true</required>
40 <comment>Name of the Campaign.</comment>
41 <import>true</import>
42 <html>
43 <type>Text</type>
44 </html>
45 <add>3.3</add>
46 </field>
47 <index>
48 <name>UI_campaign_name</name>
49 <fieldName>name</fieldName>
50 <add>5.34</add>
51 </index>
52 <field>
53 <name>title</name>
54 <title>Campaign Title</title>
55 <type>varchar</type>
56 <length>255</length>
57 <comment>Title of the Campaign.</comment>
58 <import>true</import>
59 <html>
60 <type>Text</type>
61 </html>
62 <add>3.3</add>
63 </field>
64
65 <field>
66 <name>description</name>
67 <title>Campaign Description</title>
68 <type>text</type>
69 <html>
70 <type>TextArea</type>
71 <rows>8</rows>
72 <cols>60</cols>
73 </html>
74 <comment>Full description of Campaign.</comment>
75 <add>3.3</add>
76 </field>
77
78 <field>
79 <name>start_date</name>
80 <title>Campaign Start Date</title>
81 <type>datetime</type>
82 <headerPattern>/^start|(s(tart\s)?date)$/i</headerPattern>
83 <comment>Date and time that Campaign starts.</comment>
84 <import>true</import>
85 <html>
86 <type>Select Date</type>
87 <formatType>activityDateTime</formatType>
88 </html>
89 <add>3.3</add>
90 </field>
91
92 <field>
93 <name>end_date</name>
94 <title>Campaign End Date</title>
95 <type>datetime</type>
96 <headerPattern>/^end|(e(nd\s)?date)$/i</headerPattern>
97 <comment>Date and time that Campaign ends.</comment>
98 <import>true</import>
99 <html>
100 <type>Select Date</type>
101 <formatType>activityDateTime</formatType>
102 </html>
103 <add>3.3</add>
104 </field>
105
106 <field>
107 <name>campaign_type_id</name>
108 <title>Campaign Type</title>
109 <type>int unsigned</type>
110 <default>NULL</default>
111 <comment>Campaign Type ID.Implicit FK to civicrm_option_value where option_group = campaign_type</comment>
112 <import>true</import>
113 <pseudoconstant>
114 <optionGroupName>campaign_type</optionGroupName>
115 </pseudoconstant>
116 <html>
117 <type>Select</type>
118 </html>
119 <add>3.3</add>
120 </field>
121 <index>
122 <name>UI_campaign_type_id</name>
123 <fieldName>campaign_type_id</fieldName>
124 <add>3.3</add>
125 </index>
126
127 <field>
128 <name>status_id</name>
129 <title>Campaign Status</title>
130 <type>int unsigned</type>
131 <default>NULL</default>
132 <comment>Campaign status ID.Implicit FK to civicrm_option_value where option_group = campaign_status</comment>
133 <import>true</import>
134 <pseudoconstant>
135 <optionGroupName>campaign_status</optionGroupName>
136 </pseudoconstant>
137 <html>
138 <type>Select</type>
139 </html>
140 <add>3.3</add>
141 </field>
142 <index>
143 <name>UI_campaign_status_id</name>
144 <fieldName>status_id</fieldName>
145 <add>3.3</add>
146 </index>
147
148 <field>
149 <name>external_identifier</name>
150 <type>varchar</type>
151 <title>Campaign External ID</title>
152 <length>32</length>
153 <headerPattern>/external\s?id/i</headerPattern>
154 <dataPattern>/^\d{11,}$/</dataPattern>
155 <comment>Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.</comment>
156 <import>true</import>
157 <add>3.3</add>
158 <html>
159 <type>Text</type>
160 </html>
161 </field>
162 <index>
163 <name>UI_external_identifier</name>
164 <unique>true</unique>
165 <fieldName>external_identifier</fieldName>
166 <add>3.3</add>
167 </index>
168
169 <field>
170 <name>parent_id</name>
171 <title>Parent Campaign ID</title>
172 <type>int unsigned</type>
173 <default>NULL</default>
174 <comment>Optional parent id for this Campaign.</comment>
175 <import>true</import>
176 <add>3.3</add>
177 <html>
178 <type>EntityRef</type>
179 <label>Parent Campaign</label>
180 </html>
181 </field>
182 <foreignKey>
183 <name>parent_id</name>
184 <table>civicrm_campaign</table>
185 <key>id</key>
186 <add>3.3</add>
187 <onDelete>SET NULL</onDelete>
188 </foreignKey>
189
190 <field>
191 <name>is_active</name>
192 <title>Is Campaign Active?</title>
193 <type>boolean</type>
194 <default>1</default>
195 <comment>Is this Campaign enabled or disabled/cancelled?</comment>
196 <add>3.3</add>
197 <html>
198 <type>CheckBox</type>
199 </html>
200 </field>
201
202 <field>
203 <name>created_id</name>
204 <type>int unsigned</type>
205 <title>Created By Contact ID</title>
206 <comment>FK to civicrm_contact, who created this Campaign.</comment>
207 <html>
208 <label>Created By</label>
209 </html>
210 <add>3.3</add>
211 </field>
212 <foreignKey>
213 <name>created_id</name>
214 <table>civicrm_contact</table>
215 <key>id</key>
216 <add>3.3</add>
217 <onDelete>SET NULL</onDelete>
218 </foreignKey>
219
220 <field>
221 <name>created_date</name>
222 <type>datetime</type>
223 <title>Campaign Created Date</title>
224 <comment>Date and time that Campaign was created.</comment>
225 <add>3.3</add>
226 <html>
227 <type>Select Date</type>
228 <formatType>activityDateTime</formatType>
229 </html>
230 </field>
231
232 <field>
233 <name>last_modified_id</name>
234 <type>int unsigned</type>
235 <title>Modified By Contact ID</title>
236 <comment>FK to civicrm_contact, who recently edited this Campaign.</comment>
237 <html>
238 <label>Modified By</label>
239 </html>
240 <add>3.3</add>
241 </field>
242 <foreignKey>
243 <name>last_modified_id</name>
244 <table>civicrm_contact</table>
245 <key>id</key>
246 <add>3.3</add>
247 <onDelete>SET NULL</onDelete>
248 </foreignKey>
249
250 <field>
251 <name>last_modified_date</name>
252 <type>datetime</type>
253 <title>Campaign Modified Date</title>
254 <comment>Date and time that Campaign was edited last time.</comment>
255 <add>3.3</add>
256 </field>
257 <field>
258 <name>goal_general</name>
259 <type>text</type>
260 <title>Campaign Goals</title>
261 <comment>General goals for Campaign.</comment>
262 <add>3.4</add>
263 <html>
264 <type>RichTextEditor</type>
265 </html>
266 </field>
267 <field>
268 <name>goal_revenue</name>
269 <type>decimal</type>
270 <comment>The target revenue for this campaign.</comment>
271 <add>3.4</add>
272 <html>
273 <type>Text</type>
274 <label>Goal Revenue</label>
275 </html>
276 </field>
277 </table>