Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Contact/Contact.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
8ab43c93 | 9 | * (GenCodeChecksum:e34bde9c7a6fcbfdc33cd9cbc305f1fb) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Contact entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Contact_DAO_Contact extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = '1.1'; | |
c3fc2621 | 18 | |
e501603b | 19 | /** |
f41f0342 | 20 | * Static instance to hold the table name. |
e501603b TO |
21 | * |
22 | * @var string | |
23 | */ | |
fa45b5b9 | 24 | public static $_tableName = 'civicrm_contact'; |
c3fc2621 | 25 | |
449c4e6b CW |
26 | /** |
27 | * Icon associated with this entity. | |
28 | * | |
29 | * @var string | |
30 | */ | |
31 | public static $_icon = 'fa-address-book-o'; | |
32 | ||
8ab43c93 CW |
33 | /** |
34 | * Field to show when displaying a record. | |
35 | * | |
36 | * @var string | |
37 | */ | |
38 | public static $_labelField = 'display_name'; | |
39 | ||
e501603b | 40 | /** |
f41f0342 | 41 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 42 | * |
c3fc2621 | 43 | * @var bool |
e501603b | 44 | */ |
fa45b5b9 | 45 | public static $_log = TRUE; |
c3fc2621 | 46 | |
a7bd99ff CW |
47 | /** |
48 | * Paths for accessing this entity in the UI. | |
49 | * | |
50 | * @var string[] | |
51 | */ | |
52 | protected static $_paths = [ | |
5c385299 | 53 | 'add' => 'civicrm/contact/add?reset=1&ct=[contact_type]', |
a7bd99ff | 54 | 'view' => 'civicrm/contact/view?reset=1&cid=[id]', |
5c385299 | 55 | 'update' => 'civicrm/contact/add?reset=1&action=update&cid=[id]', |
a7bd99ff CW |
56 | 'delete' => 'civicrm/contact/view/delete?reset=1&delete=1&cid=[id]', |
57 | ]; | |
58 | ||
e501603b TO |
59 | /** |
60 | * Unique Contact ID | |
61 | * | |
e6ca0a57 | 62 | * @var int |
e501603b TO |
63 | */ |
64 | public $id; | |
c3fc2621 | 65 | |
e501603b TO |
66 | /** |
67 | * Type of Contact. | |
68 | * | |
69 | * @var string | |
70 | */ | |
71 | public $contact_type; | |
c3fc2621 | 72 | |
e501603b TO |
73 | /** |
74 | * May be used to over-ride contact view and edit templates. | |
75 | * | |
76 | * @var string | |
77 | */ | |
78 | public $contact_sub_type; | |
c3fc2621 | 79 | |
e501603b | 80 | /** |
e6ca0a57 | 81 | * @var bool |
e501603b TO |
82 | */ |
83 | public $do_not_email; | |
c3fc2621 | 84 | |
e501603b | 85 | /** |
e6ca0a57 | 86 | * @var bool |
e501603b TO |
87 | */ |
88 | public $do_not_phone; | |
c3fc2621 | 89 | |
e501603b | 90 | /** |
e6ca0a57 | 91 | * @var bool |
e501603b TO |
92 | */ |
93 | public $do_not_mail; | |
c3fc2621 | 94 | |
e501603b | 95 | /** |
e6ca0a57 | 96 | * @var bool |
e501603b TO |
97 | */ |
98 | public $do_not_sms; | |
c3fc2621 | 99 | |
e501603b | 100 | /** |
e6ca0a57 | 101 | * @var bool |
e501603b TO |
102 | */ |
103 | public $do_not_trade; | |
c3fc2621 | 104 | |
e501603b TO |
105 | /** |
106 | * Has the contact opted out from receiving all bulk email from the organization or site domain? | |
107 | * | |
e6ca0a57 | 108 | * @var bool |
e501603b TO |
109 | */ |
110 | public $is_opt_out; | |
c3fc2621 | 111 | |
e501603b TO |
112 | /** |
113 | * May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID. | |
114 | * | |
115 | * @var string | |
116 | */ | |
117 | public $legal_identifier; | |
c3fc2621 | 118 | |
e501603b TO |
119 | /** |
120 | * Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations. | |
121 | * | |
122 | * @var string | |
123 | */ | |
124 | public $external_identifier; | |
c3fc2621 | 125 | |
e501603b TO |
126 | /** |
127 | * Name used for sorting different contact types | |
128 | * | |
129 | * @var string | |
130 | */ | |
131 | public $sort_name; | |
c3fc2621 | 132 | |
e501603b TO |
133 | /** |
134 | * Formatted name representing preferred format for display/print/other output. | |
135 | * | |
136 | * @var string | |
137 | */ | |
138 | public $display_name; | |
c3fc2621 | 139 | |
e501603b TO |
140 | /** |
141 | * Nickname. | |
142 | * | |
143 | * @var string | |
144 | */ | |
145 | public $nick_name; | |
c3fc2621 | 146 | |
e501603b TO |
147 | /** |
148 | * Legal Name. | |
149 | * | |
150 | * @var string | |
151 | */ | |
152 | public $legal_name; | |
c3fc2621 | 153 | |
e501603b TO |
154 | /** |
155 | * optional URL for preferred image (photo, logo, etc.) to display for this contact. | |
156 | * | |
157 | * @var text | |
158 | */ | |
159 | public $image_URL; | |
c3fc2621 | 160 | |
e501603b TO |
161 | /** |
162 | * What is the preferred mode of communication. | |
163 | * | |
164 | * @var string | |
165 | */ | |
166 | public $preferred_communication_method; | |
c3fc2621 | 167 | |
e501603b TO |
168 | /** |
169 | * Which language is preferred for communication. FK to languages in civicrm_option_value. | |
170 | * | |
171 | * @var string | |
172 | */ | |
173 | public $preferred_language; | |
c3fc2621 | 174 | |
e501603b TO |
175 | /** |
176 | * What is the preferred mode of sending an email. | |
177 | * | |
178 | * @var string | |
179 | */ | |
180 | public $preferred_mail_format; | |
c3fc2621 | 181 | |
e501603b TO |
182 | /** |
183 | * Key for validating requests related to this contact. | |
184 | * | |
185 | * @var string | |
186 | */ | |
187 | public $hash; | |
c3fc2621 | 188 | |
e501603b TO |
189 | /** |
190 | * API Key for validating requests related to this contact. | |
191 | * | |
192 | * @var string | |
193 | */ | |
194 | public $api_key; | |
c3fc2621 | 195 | |
e501603b TO |
196 | /** |
197 | * where contact come from, e.g. import, donate module insert... | |
198 | * | |
199 | * @var string | |
200 | */ | |
201 | public $source; | |
c3fc2621 | 202 | |
e501603b TO |
203 | /** |
204 | * First Name. | |
205 | * | |
206 | * @var string | |
207 | */ | |
208 | public $first_name; | |
c3fc2621 | 209 | |
e501603b TO |
210 | /** |
211 | * Middle Name. | |
212 | * | |
213 | * @var string | |
214 | */ | |
215 | public $middle_name; | |
c3fc2621 | 216 | |
e501603b TO |
217 | /** |
218 | * Last Name. | |
219 | * | |
220 | * @var string | |
221 | */ | |
222 | public $last_name; | |
c3fc2621 | 223 | |
e501603b TO |
224 | /** |
225 | * Prefix or Title for name (Ms, Mr...). FK to prefix ID | |
226 | * | |
e6ca0a57 | 227 | * @var int |
e501603b TO |
228 | */ |
229 | public $prefix_id; | |
c3fc2621 | 230 | |
e501603b TO |
231 | /** |
232 | * Suffix for name (Jr, Sr...). FK to suffix ID | |
233 | * | |
e6ca0a57 | 234 | * @var int |
e501603b TO |
235 | */ |
236 | public $suffix_id; | |
c3fc2621 | 237 | |
e501603b TO |
238 | /** |
239 | * Formal (academic or similar) title in front of name. (Prof., Dr. etc.) | |
240 | * | |
241 | * @var string | |
242 | */ | |
243 | public $formal_title; | |
c3fc2621 | 244 | |
e501603b TO |
245 | /** |
246 | * Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value. | |
247 | * | |
e6ca0a57 | 248 | * @var int |
e501603b TO |
249 | */ |
250 | public $communication_style_id; | |
c3fc2621 | 251 | |
e501603b TO |
252 | /** |
253 | * FK to civicrm_option_value.id, that has to be valid registered Email Greeting. | |
254 | * | |
e6ca0a57 | 255 | * @var int |
e501603b TO |
256 | */ |
257 | public $email_greeting_id; | |
c3fc2621 | 258 | |
e501603b TO |
259 | /** |
260 | * Custom Email Greeting. | |
261 | * | |
262 | * @var string | |
263 | */ | |
264 | public $email_greeting_custom; | |
c3fc2621 | 265 | |
e501603b TO |
266 | /** |
267 | * Cache Email Greeting. | |
268 | * | |
269 | * @var string | |
270 | */ | |
271 | public $email_greeting_display; | |
c3fc2621 | 272 | |
e501603b TO |
273 | /** |
274 | * FK to civicrm_option_value.id, that has to be valid registered Postal Greeting. | |
275 | * | |
e6ca0a57 | 276 | * @var int |
e501603b TO |
277 | */ |
278 | public $postal_greeting_id; | |
c3fc2621 | 279 | |
e501603b TO |
280 | /** |
281 | * Custom Postal greeting. | |
282 | * | |
283 | * @var string | |
284 | */ | |
285 | public $postal_greeting_custom; | |
c3fc2621 | 286 | |
e501603b TO |
287 | /** |
288 | * Cache Postal greeting. | |
289 | * | |
290 | * @var string | |
291 | */ | |
292 | public $postal_greeting_display; | |
c3fc2621 | 293 | |
e501603b TO |
294 | /** |
295 | * FK to civicrm_option_value.id, that has to be valid registered Addressee. | |
296 | * | |
e6ca0a57 | 297 | * @var int |
e501603b TO |
298 | */ |
299 | public $addressee_id; | |
c3fc2621 | 300 | |
e501603b TO |
301 | /** |
302 | * Custom Addressee. | |
303 | * | |
304 | * @var string | |
305 | */ | |
306 | public $addressee_custom; | |
c3fc2621 | 307 | |
e501603b TO |
308 | /** |
309 | * Cache Addressee. | |
310 | * | |
311 | * @var string | |
312 | */ | |
313 | public $addressee_display; | |
c3fc2621 | 314 | |
e501603b TO |
315 | /** |
316 | * Job Title | |
317 | * | |
318 | * @var string | |
319 | */ | |
320 | public $job_title; | |
c3fc2621 | 321 | |
e501603b TO |
322 | /** |
323 | * FK to gender ID | |
324 | * | |
e6ca0a57 | 325 | * @var int |
e501603b TO |
326 | */ |
327 | public $gender_id; | |
c3fc2621 | 328 | |
e501603b TO |
329 | /** |
330 | * Date of birth | |
331 | * | |
332 | * @var date | |
333 | */ | |
334 | public $birth_date; | |
c3fc2621 | 335 | |
e501603b | 336 | /** |
e6ca0a57 | 337 | * @var bool |
e501603b TO |
338 | */ |
339 | public $is_deceased; | |
c3fc2621 | 340 | |
e501603b TO |
341 | /** |
342 | * Date of deceased | |
343 | * | |
344 | * @var date | |
345 | */ | |
346 | public $deceased_date; | |
c3fc2621 | 347 | |
e501603b TO |
348 | /** |
349 | * Household Name. | |
350 | * | |
351 | * @var string | |
352 | */ | |
353 | public $household_name; | |
c3fc2621 | 354 | |
e501603b TO |
355 | /** |
356 | * Optional FK to Primary Contact for this household. | |
357 | * | |
e6ca0a57 | 358 | * @var int |
e501603b TO |
359 | */ |
360 | public $primary_contact_id; | |
c3fc2621 | 361 | |
e501603b TO |
362 | /** |
363 | * Organization Name. | |
364 | * | |
365 | * @var string | |
366 | */ | |
367 | public $organization_name; | |
c3fc2621 | 368 | |
e501603b TO |
369 | /** |
370 | * Standard Industry Classification Code. | |
371 | * | |
372 | * @var string | |
373 | */ | |
374 | public $sic_code; | |
c3fc2621 | 375 | |
e501603b TO |
376 | /** |
377 | * the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM | |
378 | * | |
379 | * @var string | |
380 | */ | |
381 | public $user_unique_id; | |
c3fc2621 | 382 | |
e501603b TO |
383 | /** |
384 | * OPTIONAL FK to civicrm_contact record. | |
385 | * | |
e6ca0a57 | 386 | * @var int |
e501603b TO |
387 | */ |
388 | public $employer_id; | |
c3fc2621 | 389 | |
e501603b | 390 | /** |
e6ca0a57 | 391 | * @var bool |
e501603b TO |
392 | */ |
393 | public $is_deleted; | |
c3fc2621 | 394 | |
e501603b TO |
395 | /** |
396 | * When was the contact was created. | |
397 | * | |
398 | * @var timestamp | |
399 | */ | |
400 | public $created_date; | |
c3fc2621 | 401 | |
e501603b TO |
402 | /** |
403 | * When was the contact (or closely related entity) was created or modified or deleted. | |
404 | * | |
405 | * @var timestamp | |
406 | */ | |
407 | public $modified_date; | |
c3fc2621 | 408 | |
e501603b | 409 | /** |
f41f0342 | 410 | * Class constructor. |
e501603b | 411 | */ |
c3fc2621 | 412 | public function __construct() { |
e501603b TO |
413 | $this->__table = 'civicrm_contact'; |
414 | parent::__construct(); | |
415 | } | |
c3fc2621 | 416 | |
449c4e6b CW |
417 | /** |
418 | * Returns localized title of this entity. | |
7b66c3b5 AH |
419 | * |
420 | * @param bool $plural | |
421 | * Whether to return the plural version of the title. | |
449c4e6b | 422 | */ |
7b66c3b5 AH |
423 | public static function getEntityTitle($plural = FALSE) { |
424 | return $plural ? ts('Contacts') : ts('Contact'); | |
449c4e6b CW |
425 | } |
426 | ||
e501603b | 427 | /** |
f41f0342 | 428 | * Returns foreign keys and entity references. |
e501603b TO |
429 | * |
430 | * @return array | |
431 | * [CRM_Core_Reference_Interface] | |
432 | */ | |
c3fc2621 | 433 | public static function getReferenceColumns() { |
346aaaba | 434 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 435 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
436 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'primary_contact_id', 'civicrm_contact', 'id'); |
437 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'employer_id', 'civicrm_contact', 'id'); | |
346aaaba | 438 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 439 | } |
346aaaba | 440 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 441 | } |
c3fc2621 | 442 | |
e501603b TO |
443 | /** |
444 | * Returns all the column names of this table | |
445 | * | |
446 | * @return array | |
447 | */ | |
c3fc2621 | 448 | public static function &fields() { |
346aaaba | 449 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
450 | Civi::$statics[__CLASS__]['fields'] = [ |
451 | 'id' => [ | |
e501603b TO |
452 | 'name' => 'id', |
453 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 454 | 'title' => ts('Contact ID'), |
215b423e | 455 | 'description' => ts('Unique Contact ID'), |
c3fc2621 CW |
456 | 'required' => TRUE, |
457 | 'import' => TRUE, | |
e501603b TO |
458 | 'where' => 'civicrm_contact.id', |
459 | 'headerPattern' => '/internal|contact?|id$/i', | |
c3fc2621 | 460 | 'export' => TRUE, |
522a26c9 | 461 | 'table_name' => 'civicrm_contact', |
462 | 'entity' => 'Contact', | |
463 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 464 | 'localizable' => 0, |
a9d0587b | 465 | 'add' => '1.1', |
c3fc2621 CW |
466 | ], |
467 | 'contact_type' => [ | |
e501603b TO |
468 | 'name' => 'contact_type', |
469 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 470 | 'title' => ts('Contact Type'), |
215b423e | 471 | 'description' => ts('Type of Contact.'), |
e501603b TO |
472 | 'maxlength' => 64, |
473 | 'size' => CRM_Utils_Type::BIG, | |
e501603b | 474 | 'where' => 'civicrm_contact.contact_type', |
a36434b9 | 475 | 'export' => TRUE, |
f5c0f096 | 476 | 'contactType' => NULL, |
522a26c9 | 477 | 'table_name' => 'civicrm_contact', |
478 | 'entity' => 'Contact', | |
479 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 480 | 'localizable' => 0, |
c3fc2621 | 481 | 'html' => [ |
e501603b | 482 | 'type' => 'Select', |
c3fc2621 CW |
483 | ], |
484 | 'pseudoconstant' => [ | |
e501603b TO |
485 | 'table' => 'civicrm_contact_type', |
486 | 'keyColumn' => 'name', | |
487 | 'labelColumn' => 'label', | |
488 | 'condition' => 'parent_id IS NULL', | |
e6ca0a57 | 489 | ], |
a9d0587b | 490 | 'add' => '1.1', |
c3fc2621 CW |
491 | ], |
492 | 'contact_sub_type' => [ | |
e501603b TO |
493 | 'name' => 'contact_sub_type', |
494 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 495 | 'title' => ts('Contact Subtype'), |
215b423e | 496 | 'description' => ts('May be used to over-ride contact view and edit templates.'), |
e501603b TO |
497 | 'maxlength' => 255, |
498 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 499 | 'import' => TRUE, |
e501603b TO |
500 | 'where' => 'civicrm_contact.contact_sub_type', |
501 | 'headerPattern' => '/C(ontact )?(subtype|sub-type|sub type)/i', | |
c3fc2621 | 502 | 'export' => TRUE, |
522a26c9 | 503 | 'table_name' => 'civicrm_contact', |
504 | 'entity' => 'Contact', | |
505 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 506 | 'localizable' => 0, |
2a5c9b4d | 507 | 'serialize' => self::SERIALIZE_SEPARATOR_BOOKEND, |
c3fc2621 | 508 | 'html' => [ |
e501603b | 509 | 'type' => 'Select', |
c3fc2621 CW |
510 | ], |
511 | 'pseudoconstant' => [ | |
e501603b TO |
512 | 'table' => 'civicrm_contact_type', |
513 | 'keyColumn' => 'name', | |
514 | 'labelColumn' => 'label', | |
515 | 'condition' => 'parent_id IS NOT NULL', | |
e6ca0a57 | 516 | ], |
a9d0587b | 517 | 'add' => '1.5', |
c3fc2621 CW |
518 | ], |
519 | 'do_not_email' => [ | |
e501603b TO |
520 | 'name' => 'do_not_email', |
521 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 CW |
522 | 'title' => ts('Do Not Email'), |
523 | 'import' => TRUE, | |
e501603b TO |
524 | 'where' => 'civicrm_contact.do_not_email', |
525 | 'headerPattern' => '/d(o )?(not )?(email)/i', | |
526 | 'dataPattern' => '/^\d{1,}$/', | |
c3fc2621 | 527 | 'export' => TRUE, |
45a83e42 | 528 | 'default' => '0', |
522a26c9 | 529 | 'table_name' => 'civicrm_contact', |
530 | 'entity' => 'Contact', | |
531 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 532 | 'localizable' => 0, |
c3fc2621 | 533 | 'html' => [ |
e501603b | 534 | 'type' => 'CheckBox', |
c3fc2621 | 535 | ], |
a9d0587b | 536 | 'add' => '1.1', |
c3fc2621 CW |
537 | ], |
538 | 'do_not_phone' => [ | |
e501603b TO |
539 | 'name' => 'do_not_phone', |
540 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 CW |
541 | 'title' => ts('Do Not Phone'), |
542 | 'import' => TRUE, | |
e501603b TO |
543 | 'where' => 'civicrm_contact.do_not_phone', |
544 | 'headerPattern' => '/d(o )?(not )?(call|phone)/i', | |
545 | 'dataPattern' => '/^\d{1,}$/', | |
c3fc2621 | 546 | 'export' => TRUE, |
45a83e42 | 547 | 'default' => '0', |
522a26c9 | 548 | 'table_name' => 'civicrm_contact', |
549 | 'entity' => 'Contact', | |
550 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 551 | 'localizable' => 0, |
c3fc2621 | 552 | 'html' => [ |
e501603b | 553 | 'type' => 'CheckBox', |
c3fc2621 | 554 | ], |
a9d0587b | 555 | 'add' => '1.1', |
c3fc2621 CW |
556 | ], |
557 | 'do_not_mail' => [ | |
e501603b TO |
558 | 'name' => 'do_not_mail', |
559 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 CW |
560 | 'title' => ts('Do Not Mail'), |
561 | 'import' => TRUE, | |
e501603b TO |
562 | 'where' => 'civicrm_contact.do_not_mail', |
563 | 'headerPattern' => '/^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i', | |
564 | 'dataPattern' => '/^\d{1,}$/', | |
c3fc2621 | 565 | 'export' => TRUE, |
45a83e42 | 566 | 'default' => '0', |
522a26c9 | 567 | 'table_name' => 'civicrm_contact', |
568 | 'entity' => 'Contact', | |
569 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 570 | 'localizable' => 0, |
c3fc2621 | 571 | 'html' => [ |
e501603b | 572 | 'type' => 'CheckBox', |
c3fc2621 | 573 | ], |
a9d0587b | 574 | 'add' => '1.1', |
c3fc2621 CW |
575 | ], |
576 | 'do_not_sms' => [ | |
e501603b TO |
577 | 'name' => 'do_not_sms', |
578 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 CW |
579 | 'title' => ts('Do Not Sms'), |
580 | 'import' => TRUE, | |
e501603b TO |
581 | 'where' => 'civicrm_contact.do_not_sms', |
582 | 'headerPattern' => '/d(o )?(not )?(sms)/i', | |
583 | 'dataPattern' => '/^\d{1,}$/', | |
c3fc2621 | 584 | 'export' => TRUE, |
45a83e42 | 585 | 'default' => '0', |
522a26c9 | 586 | 'table_name' => 'civicrm_contact', |
587 | 'entity' => 'Contact', | |
588 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 589 | 'localizable' => 0, |
c3fc2621 | 590 | 'html' => [ |
e501603b | 591 | 'type' => 'CheckBox', |
c3fc2621 | 592 | ], |
a9d0587b | 593 | 'add' => '3.0', |
c3fc2621 CW |
594 | ], |
595 | 'do_not_trade' => [ | |
e501603b TO |
596 | 'name' => 'do_not_trade', |
597 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 CW |
598 | 'title' => ts('Do Not Trade'), |
599 | 'import' => TRUE, | |
e501603b TO |
600 | 'where' => 'civicrm_contact.do_not_trade', |
601 | 'headerPattern' => '/d(o )?(not )?(trade)/i', | |
602 | 'dataPattern' => '/^\d{1,}$/', | |
c3fc2621 | 603 | 'export' => TRUE, |
45a83e42 | 604 | 'default' => '0', |
522a26c9 | 605 | 'table_name' => 'civicrm_contact', |
606 | 'entity' => 'Contact', | |
607 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 608 | 'localizable' => 0, |
c3fc2621 | 609 | 'html' => [ |
e501603b | 610 | 'type' => 'CheckBox', |
c3fc2621 | 611 | ], |
a9d0587b | 612 | 'add' => '1.1', |
c3fc2621 CW |
613 | ], |
614 | 'is_opt_out' => [ | |
e501603b TO |
615 | 'name' => 'is_opt_out', |
616 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 617 | 'title' => ts('No Bulk Emails (User Opt Out)'), |
215b423e | 618 | 'description' => ts('Has the contact opted out from receiving all bulk email from the organization or site domain?'), |
c3fc2621 CW |
619 | 'required' => TRUE, |
620 | 'import' => TRUE, | |
e501603b | 621 | 'where' => 'civicrm_contact.is_opt_out', |
c3fc2621 | 622 | 'export' => TRUE, |
45a83e42 | 623 | 'default' => '0', |
522a26c9 | 624 | 'table_name' => 'civicrm_contact', |
625 | 'entity' => 'Contact', | |
626 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 627 | 'localizable' => 0, |
c3fc2621 | 628 | 'html' => [ |
e501603b | 629 | 'type' => 'CheckBox', |
c3fc2621 | 630 | ], |
a9d0587b | 631 | 'add' => '1.1', |
c3fc2621 CW |
632 | ], |
633 | 'legal_identifier' => [ | |
e501603b TO |
634 | 'name' => 'legal_identifier', |
635 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 636 | 'title' => ts('Legal Identifier'), |
fb607354 | 637 | 'description' => ts('May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.'), |
e501603b TO |
638 | 'maxlength' => 32, |
639 | 'size' => CRM_Utils_Type::MEDIUM, | |
c3fc2621 | 640 | 'import' => TRUE, |
e501603b TO |
641 | 'where' => 'civicrm_contact.legal_identifier', |
642 | 'headerPattern' => '/legal\s?id/i', | |
643 | 'dataPattern' => '/\w+?\d{5,}/', | |
c3fc2621 | 644 | 'export' => TRUE, |
522a26c9 | 645 | 'table_name' => 'civicrm_contact', |
646 | 'entity' => 'Contact', | |
647 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 648 | 'localizable' => 0, |
c3fc2621 | 649 | 'html' => [ |
e501603b | 650 | 'type' => 'Text', |
c3fc2621 | 651 | ], |
a9d0587b | 652 | 'add' => '1.1', |
c3fc2621 CW |
653 | ], |
654 | 'external_identifier' => [ | |
e501603b TO |
655 | 'name' => 'external_identifier', |
656 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 657 | 'title' => ts('External Identifier'), |
215b423e | 658 | 'description' => ts('Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.'), |
e501603b TO |
659 | 'maxlength' => 64, |
660 | 'size' => 8, | |
c3fc2621 | 661 | 'import' => TRUE, |
e501603b TO |
662 | 'where' => 'civicrm_contact.external_identifier', |
663 | 'headerPattern' => '/external\s?id/i', | |
664 | 'dataPattern' => '/^\d{11,}$/', | |
c3fc2621 | 665 | 'export' => TRUE, |
522a26c9 | 666 | 'table_name' => 'civicrm_contact', |
667 | 'entity' => 'Contact', | |
668 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 669 | 'localizable' => 0, |
c3fc2621 | 670 | 'html' => [ |
e501603b | 671 | 'type' => 'Text', |
c3fc2621 | 672 | ], |
a9d0587b | 673 | 'add' => '1.1', |
c3fc2621 CW |
674 | ], |
675 | 'sort_name' => [ | |
e501603b TO |
676 | 'name' => 'sort_name', |
677 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 678 | 'title' => ts('Sort Name'), |
215b423e | 679 | 'description' => ts('Name used for sorting different contact types'), |
e501603b TO |
680 | 'maxlength' => 128, |
681 | 'size' => 30, | |
e501603b | 682 | 'where' => 'civicrm_contact.sort_name', |
a36434b9 | 683 | 'export' => TRUE, |
522a26c9 | 684 | 'table_name' => 'civicrm_contact', |
685 | 'entity' => 'Contact', | |
686 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 687 | 'localizable' => 0, |
c3fc2621 | 688 | 'html' => [ |
e501603b | 689 | 'type' => 'Text', |
c3fc2621 | 690 | ], |
a9d0587b | 691 | 'add' => '1.1', |
c3fc2621 CW |
692 | ], |
693 | 'display_name' => [ | |
e501603b TO |
694 | 'name' => 'display_name', |
695 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 696 | 'title' => ts('Display Name'), |
215b423e | 697 | 'description' => ts('Formatted name representing preferred format for display/print/other output.'), |
e501603b TO |
698 | 'maxlength' => 128, |
699 | 'size' => 30, | |
e501603b | 700 | 'where' => 'civicrm_contact.display_name', |
a36434b9 | 701 | 'export' => TRUE, |
522a26c9 | 702 | 'table_name' => 'civicrm_contact', |
703 | 'entity' => 'Contact', | |
704 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 705 | 'localizable' => 0, |
c3fc2621 | 706 | 'html' => [ |
e501603b | 707 | 'type' => 'Text', |
c3fc2621 | 708 | ], |
a9d0587b | 709 | 'add' => '1.1', |
c3fc2621 CW |
710 | ], |
711 | 'nick_name' => [ | |
e501603b TO |
712 | 'name' => 'nick_name', |
713 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 714 | 'title' => ts('Nickname'), |
215b423e | 715 | 'description' => ts('Nickname.'), |
e501603b TO |
716 | 'maxlength' => 128, |
717 | 'size' => 30, | |
c3fc2621 | 718 | 'import' => TRUE, |
e501603b TO |
719 | 'where' => 'civicrm_contact.nick_name', |
720 | 'headerPattern' => '/n(ick\s)name|nick$/i', | |
721 | 'dataPattern' => '/^\w+$/', | |
c3fc2621 | 722 | 'export' => TRUE, |
522a26c9 | 723 | 'table_name' => 'civicrm_contact', |
724 | 'entity' => 'Contact', | |
725 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 726 | 'localizable' => 0, |
c3fc2621 | 727 | 'html' => [ |
e501603b | 728 | 'type' => 'Text', |
c3fc2621 | 729 | ], |
a9d0587b | 730 | 'add' => '1.1', |
c3fc2621 CW |
731 | ], |
732 | 'legal_name' => [ | |
e501603b TO |
733 | 'name' => 'legal_name', |
734 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 735 | 'title' => ts('Legal Name'), |
215b423e | 736 | 'description' => ts('Legal Name.'), |
e501603b TO |
737 | 'maxlength' => 128, |
738 | 'size' => 30, | |
c3fc2621 | 739 | 'import' => TRUE, |
e501603b TO |
740 | 'where' => 'civicrm_contact.legal_name', |
741 | 'headerPattern' => '/^legal|(l(egal\s)?name)$/i', | |
c3fc2621 | 742 | 'export' => TRUE, |
b383d043 | 743 | 'contactType' => 'Organization', |
522a26c9 | 744 | 'table_name' => 'civicrm_contact', |
745 | 'entity' => 'Contact', | |
746 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 747 | 'localizable' => 0, |
c3fc2621 | 748 | 'html' => [ |
e501603b | 749 | 'type' => 'Text', |
c3fc2621 | 750 | ], |
a9d0587b | 751 | 'add' => '1.1', |
c3fc2621 CW |
752 | ], |
753 | 'image_URL' => [ | |
e501603b TO |
754 | 'name' => 'image_URL', |
755 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 756 | 'title' => ts('Image Url'), |
215b423e | 757 | 'description' => ts('optional URL for preferred image (photo, logo, etc.) to display for this contact.'), |
c3fc2621 | 758 | 'import' => TRUE, |
e501603b | 759 | 'where' => 'civicrm_contact.image_URL', |
c3fc2621 | 760 | 'export' => TRUE, |
522a26c9 | 761 | 'table_name' => 'civicrm_contact', |
762 | 'entity' => 'Contact', | |
763 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 764 | 'localizable' => 0, |
c3fc2621 | 765 | 'html' => [ |
e501603b | 766 | 'type' => 'File', |
c3fc2621 | 767 | ], |
a9d0587b | 768 | 'add' => '1.1', |
c3fc2621 CW |
769 | ], |
770 | 'preferred_communication_method' => [ | |
e501603b TO |
771 | 'name' => 'preferred_communication_method', |
772 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 773 | 'title' => ts('Preferred Communication Method'), |
215b423e | 774 | 'description' => ts('What is the preferred mode of communication.'), |
e501603b TO |
775 | 'maxlength' => 255, |
776 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 777 | 'import' => TRUE, |
e501603b TO |
778 | 'where' => 'civicrm_contact.preferred_communication_method', |
779 | 'headerPattern' => '/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i', | |
780 | 'dataPattern' => '/^\w+$/', | |
c3fc2621 | 781 | 'export' => TRUE, |
522a26c9 | 782 | 'table_name' => 'civicrm_contact', |
783 | 'entity' => 'Contact', | |
784 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 785 | 'localizable' => 0, |
2a5c9b4d | 786 | 'serialize' => self::SERIALIZE_SEPARATOR_BOOKEND, |
c3fc2621 | 787 | 'html' => [ |
e501603b | 788 | 'type' => 'Select', |
c3fc2621 CW |
789 | ], |
790 | 'pseudoconstant' => [ | |
e501603b TO |
791 | 'optionGroupName' => 'preferred_communication_method', |
792 | 'optionEditPath' => 'civicrm/admin/options/preferred_communication_method', | |
e6ca0a57 | 793 | ], |
a9d0587b | 794 | 'add' => '1.1', |
c3fc2621 CW |
795 | ], |
796 | 'preferred_language' => [ | |
e501603b TO |
797 | 'name' => 'preferred_language', |
798 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 799 | 'title' => ts('Preferred Language'), |
215b423e | 800 | 'description' => ts('Which language is preferred for communication. FK to languages in civicrm_option_value.'), |
e501603b TO |
801 | 'maxlength' => 5, |
802 | 'size' => CRM_Utils_Type::SIX, | |
c3fc2621 | 803 | 'import' => TRUE, |
e501603b TO |
804 | 'where' => 'civicrm_contact.preferred_language', |
805 | 'headerPattern' => '/^lang/i', | |
c3fc2621 | 806 | 'export' => TRUE, |
522a26c9 | 807 | 'table_name' => 'civicrm_contact', |
808 | 'entity' => 'Contact', | |
809 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 810 | 'localizable' => 0, |
c3fc2621 | 811 | 'html' => [ |
e501603b | 812 | 'type' => 'Select', |
c3fc2621 CW |
813 | ], |
814 | 'pseudoconstant' => [ | |
e501603b TO |
815 | 'optionGroupName' => 'languages', |
816 | 'keyColumn' => 'name', | |
817 | 'optionEditPath' => 'civicrm/admin/options/languages', | |
e6ca0a57 | 818 | ], |
a9d0587b | 819 | 'add' => '3.2', |
c3fc2621 CW |
820 | ], |
821 | 'preferred_mail_format' => [ | |
e501603b TO |
822 | 'name' => 'preferred_mail_format', |
823 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 824 | 'title' => ts('Preferred Mail Format'), |
215b423e | 825 | 'description' => ts('What is the preferred mode of sending an email.'), |
e501603b TO |
826 | 'maxlength' => 8, |
827 | 'size' => CRM_Utils_Type::EIGHT, | |
c3fc2621 | 828 | 'import' => TRUE, |
e501603b TO |
829 | 'where' => 'civicrm_contact.preferred_mail_format', |
830 | 'headerPattern' => '/^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i', | |
c3fc2621 | 831 | 'export' => TRUE, |
e501603b | 832 | 'default' => 'Both', |
522a26c9 | 833 | 'table_name' => 'civicrm_contact', |
834 | 'entity' => 'Contact', | |
835 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 836 | 'localizable' => 0, |
c3fc2621 | 837 | 'html' => [ |
e501603b | 838 | 'type' => 'Select', |
c3fc2621 CW |
839 | ], |
840 | 'pseudoconstant' => [ | |
e501603b | 841 | 'callback' => 'CRM_Core_SelectValues::pmf', |
e6ca0a57 | 842 | ], |
a9d0587b | 843 | 'add' => '1.1', |
c3fc2621 CW |
844 | ], |
845 | 'hash' => [ | |
e501603b TO |
846 | 'name' => 'hash', |
847 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 848 | 'title' => ts('Contact Hash'), |
215b423e | 849 | 'description' => ts('Key for validating requests related to this contact.'), |
e501603b TO |
850 | 'maxlength' => 32, |
851 | 'size' => CRM_Utils_Type::MEDIUM, | |
e501603b | 852 | 'where' => 'civicrm_contact.hash', |
a36434b9 | 853 | 'export' => TRUE, |
522a26c9 | 854 | 'table_name' => 'civicrm_contact', |
855 | 'entity' => 'Contact', | |
856 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 857 | 'localizable' => 0, |
a9d0587b | 858 | 'add' => '1.1', |
c3fc2621 CW |
859 | ], |
860 | 'api_key' => [ | |
e501603b TO |
861 | 'name' => 'api_key', |
862 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 863 | 'title' => ts('Api Key'), |
215b423e | 864 | 'description' => ts('API Key for validating requests related to this contact.'), |
e501603b TO |
865 | 'maxlength' => 32, |
866 | 'size' => CRM_Utils_Type::MEDIUM, | |
a36434b9 | 867 | 'where' => 'civicrm_contact.api_key', |
1713a0ec CW |
868 | 'permission' => [ |
869 | [ | |
870 | 'administer CiviCRM', | |
871 | 'edit api keys', | |
872 | ], | |
873 | ], | |
522a26c9 | 874 | 'table_name' => 'civicrm_contact', |
875 | 'entity' => 'Contact', | |
876 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 877 | 'localizable' => 0, |
a9d0587b | 878 | 'add' => '2.2', |
c3fc2621 CW |
879 | ], |
880 | 'contact_source' => [ | |
e501603b TO |
881 | 'name' => 'source', |
882 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 883 | 'title' => ts('Contact Source'), |
215b423e | 884 | 'description' => ts('where contact come from, e.g. import, donate module insert...'), |
e501603b TO |
885 | 'maxlength' => 255, |
886 | 'size' => 30, | |
c3fc2621 | 887 | 'import' => TRUE, |
e501603b TO |
888 | 'where' => 'civicrm_contact.source', |
889 | 'headerPattern' => '/(C(ontact\s)?Source)$/i', | |
c3fc2621 | 890 | 'export' => TRUE, |
522a26c9 | 891 | 'table_name' => 'civicrm_contact', |
892 | 'entity' => 'Contact', | |
893 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 894 | 'localizable' => 0, |
c3fc2621 | 895 | 'html' => [ |
e501603b | 896 | 'type' => 'Text', |
c3fc2621 | 897 | ], |
a9d0587b | 898 | 'add' => '1.1', |
c3fc2621 CW |
899 | ], |
900 | 'first_name' => [ | |
e501603b TO |
901 | 'name' => 'first_name', |
902 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 903 | 'title' => ts('First Name'), |
215b423e | 904 | 'description' => ts('First Name.'), |
e501603b TO |
905 | 'maxlength' => 64, |
906 | 'size' => 30, | |
c3fc2621 | 907 | 'import' => TRUE, |
e501603b TO |
908 | 'where' => 'civicrm_contact.first_name', |
909 | 'headerPattern' => '/^first|(f(irst\s)?name)$/i', | |
910 | 'dataPattern' => '/^\w+$/', | |
c3fc2621 | 911 | 'export' => TRUE, |
f5c0f096 | 912 | 'contactType' => 'Individual', |
522a26c9 | 913 | 'table_name' => 'civicrm_contact', |
914 | 'entity' => 'Contact', | |
915 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 916 | 'localizable' => 0, |
c3fc2621 | 917 | 'html' => [ |
e501603b | 918 | 'type' => 'Text', |
c3fc2621 | 919 | ], |
a9d0587b | 920 | 'add' => '1.1', |
c3fc2621 CW |
921 | ], |
922 | 'middle_name' => [ | |
e501603b TO |
923 | 'name' => 'middle_name', |
924 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 925 | 'title' => ts('Middle Name'), |
215b423e | 926 | 'description' => ts('Middle Name.'), |
e501603b TO |
927 | 'maxlength' => 64, |
928 | 'size' => 30, | |
c3fc2621 | 929 | 'import' => TRUE, |
e501603b TO |
930 | 'where' => 'civicrm_contact.middle_name', |
931 | 'headerPattern' => '/^middle|(m(iddle\s)?name)$/i', | |
932 | 'dataPattern' => '/^\w+$/', | |
c3fc2621 | 933 | 'export' => TRUE, |
f5c0f096 | 934 | 'contactType' => 'Individual', |
522a26c9 | 935 | 'table_name' => 'civicrm_contact', |
936 | 'entity' => 'Contact', | |
937 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 938 | 'localizable' => 0, |
c3fc2621 | 939 | 'html' => [ |
e501603b | 940 | 'type' => 'Text', |
c3fc2621 | 941 | ], |
a9d0587b | 942 | 'add' => '1.1', |
c3fc2621 CW |
943 | ], |
944 | 'last_name' => [ | |
e501603b TO |
945 | 'name' => 'last_name', |
946 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 947 | 'title' => ts('Last Name'), |
215b423e | 948 | 'description' => ts('Last Name.'), |
e501603b TO |
949 | 'maxlength' => 64, |
950 | 'size' => 30, | |
c3fc2621 | 951 | 'import' => TRUE, |
e501603b TO |
952 | 'where' => 'civicrm_contact.last_name', |
953 | 'headerPattern' => '/^last|(l(ast\s)?name)$/i', | |
954 | 'dataPattern' => '/^\w+(\s\w+)?+$/', | |
c3fc2621 | 955 | 'export' => TRUE, |
f5c0f096 | 956 | 'contactType' => 'Individual', |
522a26c9 | 957 | 'table_name' => 'civicrm_contact', |
958 | 'entity' => 'Contact', | |
959 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 960 | 'localizable' => 0, |
c3fc2621 | 961 | 'html' => [ |
e501603b | 962 | 'type' => 'Text', |
c3fc2621 | 963 | ], |
a9d0587b | 964 | 'add' => '1.1', |
c3fc2621 CW |
965 | ], |
966 | 'prefix_id' => [ | |
e501603b TO |
967 | 'name' => 'prefix_id', |
968 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 969 | 'title' => ts('Individual Prefix'), |
215b423e | 970 | 'description' => ts('Prefix or Title for name (Ms, Mr...). FK to prefix ID'), |
c3fc2621 | 971 | 'import' => TRUE, |
e501603b TO |
972 | 'where' => 'civicrm_contact.prefix_id', |
973 | 'headerPattern' => '/^(prefix|title)/i', | |
974 | 'dataPattern' => '/^(mr|ms|mrs|sir|dr)\.?$/i', | |
c3fc2621 | 975 | 'export' => TRUE, |
f5c0f096 | 976 | 'contactType' => 'Individual', |
522a26c9 | 977 | 'table_name' => 'civicrm_contact', |
978 | 'entity' => 'Contact', | |
979 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 980 | 'localizable' => 0, |
c3fc2621 | 981 | 'html' => [ |
e501603b | 982 | 'type' => 'Select', |
c3fc2621 CW |
983 | ], |
984 | 'pseudoconstant' => [ | |
e501603b TO |
985 | 'optionGroupName' => 'individual_prefix', |
986 | 'optionEditPath' => 'civicrm/admin/options/individual_prefix', | |
e6ca0a57 | 987 | ], |
a9d0587b | 988 | 'add' => '1.2', |
c3fc2621 CW |
989 | ], |
990 | 'suffix_id' => [ | |
e501603b TO |
991 | 'name' => 'suffix_id', |
992 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 993 | 'title' => ts('Individual Suffix'), |
215b423e | 994 | 'description' => ts('Suffix for name (Jr, Sr...). FK to suffix ID'), |
c3fc2621 | 995 | 'import' => TRUE, |
e501603b TO |
996 | 'where' => 'civicrm_contact.suffix_id', |
997 | 'headerPattern' => '/^suffix$/i', | |
998 | 'dataPattern' => '/^(sr|jr)\.?|i{2,}$/', | |
c3fc2621 | 999 | 'export' => TRUE, |
f5c0f096 | 1000 | 'contactType' => 'Individual', |
522a26c9 | 1001 | 'table_name' => 'civicrm_contact', |
1002 | 'entity' => 'Contact', | |
1003 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1004 | 'localizable' => 0, |
c3fc2621 | 1005 | 'html' => [ |
e501603b | 1006 | 'type' => 'Select', |
c3fc2621 CW |
1007 | ], |
1008 | 'pseudoconstant' => [ | |
e501603b TO |
1009 | 'optionGroupName' => 'individual_suffix', |
1010 | 'optionEditPath' => 'civicrm/admin/options/individual_suffix', | |
e6ca0a57 | 1011 | ], |
a9d0587b | 1012 | 'add' => '1.2', |
c3fc2621 CW |
1013 | ], |
1014 | 'formal_title' => [ | |
e501603b TO |
1015 | 'name' => 'formal_title', |
1016 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1017 | 'title' => ts('Formal Title'), |
215b423e | 1018 | 'description' => ts('Formal (academic or similar) title in front of name. (Prof., Dr. etc.)'), |
e501603b TO |
1019 | 'maxlength' => 64, |
1020 | 'size' => CRM_Utils_Type::BIG, | |
c3fc2621 | 1021 | 'import' => TRUE, |
e501603b TO |
1022 | 'where' => 'civicrm_contact.formal_title', |
1023 | 'headerPattern' => '/^title/i', | |
c3fc2621 | 1024 | 'export' => TRUE, |
f5c0f096 | 1025 | 'contactType' => 'Individual', |
522a26c9 | 1026 | 'table_name' => 'civicrm_contact', |
1027 | 'entity' => 'Contact', | |
1028 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1029 | 'localizable' => 0, |
c3fc2621 | 1030 | 'html' => [ |
e501603b | 1031 | 'type' => 'Text', |
c3fc2621 | 1032 | ], |
a9d0587b | 1033 | 'add' => '4.5', |
c3fc2621 CW |
1034 | ], |
1035 | 'communication_style_id' => [ | |
e501603b TO |
1036 | 'name' => 'communication_style_id', |
1037 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 1038 | 'title' => ts('Communication Style'), |
215b423e | 1039 | 'description' => ts('Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.'), |
1a18ea39 | 1040 | 'import' => TRUE, |
e501603b | 1041 | 'where' => 'civicrm_contact.communication_style_id', |
1a18ea39 | 1042 | 'headerPattern' => '/style/i', |
a36434b9 | 1043 | 'export' => TRUE, |
522a26c9 | 1044 | 'table_name' => 'civicrm_contact', |
1045 | 'entity' => 'Contact', | |
1046 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1047 | 'localizable' => 0, |
c3fc2621 | 1048 | 'html' => [ |
e501603b | 1049 | 'type' => 'Select', |
c3fc2621 CW |
1050 | ], |
1051 | 'pseudoconstant' => [ | |
e501603b TO |
1052 | 'optionGroupName' => 'communication_style', |
1053 | 'optionEditPath' => 'civicrm/admin/options/communication_style', | |
e6ca0a57 | 1054 | ], |
a9d0587b | 1055 | 'add' => '4.4', |
c3fc2621 CW |
1056 | ], |
1057 | 'email_greeting_id' => [ | |
e501603b TO |
1058 | 'name' => 'email_greeting_id', |
1059 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 1060 | 'title' => ts('Email Greeting ID'), |
215b423e | 1061 | 'description' => ts('FK to civicrm_option_value.id, that has to be valid registered Email Greeting.'), |
54e389ac | 1062 | 'where' => 'civicrm_contact.email_greeting_id', |
a36434b9 | 1063 | 'export' => TRUE, |
522a26c9 | 1064 | 'table_name' => 'civicrm_contact', |
1065 | 'entity' => 'Contact', | |
1066 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1067 | 'localizable' => 0, |
3542118f CW |
1068 | 'html' => [ |
1069 | 'type' => 'Select', | |
1070 | ], | |
c3fc2621 | 1071 | 'pseudoconstant' => [ |
f4a9693e SL |
1072 | 'optionGroupName' => 'email_greeting', |
1073 | 'optionEditPath' => 'civicrm/admin/options/email_greeting', | |
e6ca0a57 | 1074 | ], |
a9d0587b | 1075 | 'add' => '3.0', |
c3fc2621 CW |
1076 | ], |
1077 | 'email_greeting_custom' => [ | |
e501603b TO |
1078 | 'name' => 'email_greeting_custom', |
1079 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1080 | 'title' => ts('Email Greeting Custom'), |
215b423e | 1081 | 'description' => ts('Custom Email Greeting.'), |
e501603b TO |
1082 | 'maxlength' => 128, |
1083 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 1084 | 'import' => TRUE, |
e501603b | 1085 | 'where' => 'civicrm_contact.email_greeting_custom', |
c3fc2621 | 1086 | 'export' => FALSE, |
522a26c9 | 1087 | 'table_name' => 'civicrm_contact', |
1088 | 'entity' => 'Contact', | |
1089 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1090 | 'localizable' => 0, |
c3fc2621 | 1091 | 'html' => [ |
e501603b | 1092 | 'type' => 'Text', |
c3fc2621 | 1093 | ], |
a9d0587b | 1094 | 'add' => '3.0', |
c3fc2621 CW |
1095 | ], |
1096 | 'email_greeting_display' => [ | |
e501603b TO |
1097 | 'name' => 'email_greeting_display', |
1098 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1099 | 'title' => ts('Email Greeting'), |
215b423e | 1100 | 'description' => ts('Cache Email Greeting.'), |
e501603b TO |
1101 | 'maxlength' => 255, |
1102 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 1103 | 'where' => 'civicrm_contact.email_greeting_display', |
522a26c9 | 1104 | 'table_name' => 'civicrm_contact', |
1105 | 'entity' => 'Contact', | |
1106 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1107 | 'localizable' => 0, |
a9d0587b | 1108 | 'add' => '3.0', |
c3fc2621 CW |
1109 | ], |
1110 | 'postal_greeting_id' => [ | |
e501603b TO |
1111 | 'name' => 'postal_greeting_id', |
1112 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 1113 | 'title' => ts('Postal Greeting ID'), |
215b423e | 1114 | 'description' => ts('FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.'), |
54e389ac | 1115 | 'where' => 'civicrm_contact.postal_greeting_id', |
a36434b9 | 1116 | 'export' => TRUE, |
522a26c9 | 1117 | 'table_name' => 'civicrm_contact', |
1118 | 'entity' => 'Contact', | |
1119 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1120 | 'localizable' => 0, |
c3fc2621 | 1121 | 'html' => [ |
3542118f | 1122 | 'type' => 'Select', |
c3fc2621 CW |
1123 | ], |
1124 | 'pseudoconstant' => [ | |
f4a9693e SL |
1125 | 'optionGroupName' => 'postal_greeting', |
1126 | 'optionEditPath' => 'civicrm/admin/options/postal_greeting', | |
e6ca0a57 | 1127 | ], |
a9d0587b | 1128 | 'add' => '3.0', |
c3fc2621 CW |
1129 | ], |
1130 | 'postal_greeting_custom' => [ | |
e501603b TO |
1131 | 'name' => 'postal_greeting_custom', |
1132 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1133 | 'title' => ts('Postal Greeting Custom'), |
215b423e | 1134 | 'description' => ts('Custom Postal greeting.'), |
e501603b TO |
1135 | 'maxlength' => 128, |
1136 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 1137 | 'import' => TRUE, |
e501603b | 1138 | 'where' => 'civicrm_contact.postal_greeting_custom', |
c3fc2621 | 1139 | 'export' => FALSE, |
522a26c9 | 1140 | 'table_name' => 'civicrm_contact', |
1141 | 'entity' => 'Contact', | |
1142 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1143 | 'localizable' => 0, |
c3fc2621 | 1144 | 'html' => [ |
e501603b | 1145 | 'type' => 'Text', |
c3fc2621 | 1146 | ], |
a9d0587b | 1147 | 'add' => '3.0', |
c3fc2621 CW |
1148 | ], |
1149 | 'postal_greeting_display' => [ | |
e501603b TO |
1150 | 'name' => 'postal_greeting_display', |
1151 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1152 | 'title' => ts('Postal Greeting'), |
215b423e | 1153 | 'description' => ts('Cache Postal greeting.'), |
e501603b TO |
1154 | 'maxlength' => 255, |
1155 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 1156 | 'where' => 'civicrm_contact.postal_greeting_display', |
522a26c9 | 1157 | 'table_name' => 'civicrm_contact', |
1158 | 'entity' => 'Contact', | |
1159 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1160 | 'localizable' => 0, |
a9d0587b | 1161 | 'add' => '3.0', |
c3fc2621 CW |
1162 | ], |
1163 | 'addressee_id' => [ | |
e501603b TO |
1164 | 'name' => 'addressee_id', |
1165 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 1166 | 'title' => ts('Addressee ID'), |
215b423e | 1167 | 'description' => ts('FK to civicrm_option_value.id, that has to be valid registered Addressee.'), |
54e389ac | 1168 | 'where' => 'civicrm_contact.addressee_id', |
a36434b9 | 1169 | 'export' => TRUE, |
522a26c9 | 1170 | 'table_name' => 'civicrm_contact', |
1171 | 'entity' => 'Contact', | |
1172 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1173 | 'localizable' => 0, |
3542118f CW |
1174 | 'html' => [ |
1175 | 'type' => 'Select', | |
1176 | ], | |
c3fc2621 | 1177 | 'pseudoconstant' => [ |
a28e9198 | 1178 | 'optionGroupName' => 'addressee', |
1179 | 'optionEditPath' => 'civicrm/admin/options/addressee', | |
e6ca0a57 | 1180 | ], |
a9d0587b | 1181 | 'add' => '3.0', |
c3fc2621 CW |
1182 | ], |
1183 | 'addressee_custom' => [ | |
e501603b TO |
1184 | 'name' => 'addressee_custom', |
1185 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1186 | 'title' => ts('Addressee Custom'), |
215b423e | 1187 | 'description' => ts('Custom Addressee.'), |
e501603b TO |
1188 | 'maxlength' => 128, |
1189 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 1190 | 'import' => TRUE, |
e501603b | 1191 | 'where' => 'civicrm_contact.addressee_custom', |
c3fc2621 | 1192 | 'export' => FALSE, |
522a26c9 | 1193 | 'table_name' => 'civicrm_contact', |
1194 | 'entity' => 'Contact', | |
1195 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1196 | 'localizable' => 0, |
c3fc2621 | 1197 | 'html' => [ |
e501603b | 1198 | 'type' => 'Text', |
c3fc2621 | 1199 | ], |
a9d0587b | 1200 | 'add' => '3.0', |
c3fc2621 CW |
1201 | ], |
1202 | 'addressee_display' => [ | |
e501603b TO |
1203 | 'name' => 'addressee_display', |
1204 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1205 | 'title' => ts('Addressee'), |
215b423e | 1206 | 'description' => ts('Cache Addressee.'), |
e501603b TO |
1207 | 'maxlength' => 255, |
1208 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 1209 | 'where' => 'civicrm_contact.addressee_display', |
522a26c9 | 1210 | 'table_name' => 'civicrm_contact', |
1211 | 'entity' => 'Contact', | |
1212 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1213 | 'localizable' => 0, |
a9d0587b | 1214 | 'add' => '3.0', |
c3fc2621 CW |
1215 | ], |
1216 | 'job_title' => [ | |
e501603b TO |
1217 | 'name' => 'job_title', |
1218 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1219 | 'title' => ts('Job Title'), |
215b423e | 1220 | 'description' => ts('Job Title'), |
e501603b TO |
1221 | 'maxlength' => 255, |
1222 | 'size' => 30, | |
c3fc2621 | 1223 | 'import' => TRUE, |
e501603b TO |
1224 | 'where' => 'civicrm_contact.job_title', |
1225 | 'headerPattern' => '/^job|(j(ob\s)?title)$/i', | |
1226 | 'dataPattern' => '//', | |
c3fc2621 | 1227 | 'export' => TRUE, |
f5c0f096 | 1228 | 'contactType' => 'Individual', |
522a26c9 | 1229 | 'table_name' => 'civicrm_contact', |
1230 | 'entity' => 'Contact', | |
1231 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1232 | 'localizable' => 0, |
c3fc2621 | 1233 | 'html' => [ |
e501603b | 1234 | 'type' => 'Text', |
c3fc2621 | 1235 | ], |
a9d0587b | 1236 | 'add' => '1.1', |
c3fc2621 CW |
1237 | ], |
1238 | 'gender_id' => [ | |
e501603b TO |
1239 | 'name' => 'gender_id', |
1240 | 'type' => CRM_Utils_Type::T_INT, | |
9ac33d0f | 1241 | 'title' => ts('Gender ID'), |
215b423e | 1242 | 'description' => ts('FK to gender ID'), |
c3fc2621 | 1243 | 'import' => TRUE, |
e501603b TO |
1244 | 'where' => 'civicrm_contact.gender_id', |
1245 | 'headerPattern' => '/^gender$/i', | |
c3fc2621 | 1246 | 'export' => TRUE, |
f5c0f096 | 1247 | 'contactType' => 'Individual', |
522a26c9 | 1248 | 'table_name' => 'civicrm_contact', |
1249 | 'entity' => 'Contact', | |
1250 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1251 | 'localizable' => 0, |
c3fc2621 | 1252 | 'html' => [ |
e501603b | 1253 | 'type' => 'Select', |
9ac33d0f | 1254 | 'label' => ts("Gender"), |
c3fc2621 CW |
1255 | ], |
1256 | 'pseudoconstant' => [ | |
e501603b TO |
1257 | 'optionGroupName' => 'gender', |
1258 | 'optionEditPath' => 'civicrm/admin/options/gender', | |
e6ca0a57 | 1259 | ], |
a9d0587b | 1260 | 'add' => '1.2', |
c3fc2621 CW |
1261 | ], |
1262 | 'birth_date' => [ | |
e501603b TO |
1263 | 'name' => 'birth_date', |
1264 | 'type' => CRM_Utils_Type::T_DATE, | |
c3fc2621 | 1265 | 'title' => ts('Birth Date'), |
215b423e | 1266 | 'description' => ts('Date of birth'), |
c3fc2621 | 1267 | 'import' => TRUE, |
e501603b TO |
1268 | 'where' => 'civicrm_contact.birth_date', |
1269 | 'headerPattern' => '/^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i', | |
1270 | 'dataPattern' => '/\d{4}-?\d{2}-?\d{2}/', | |
c3fc2621 | 1271 | 'export' => TRUE, |
f5c0f096 | 1272 | 'contactType' => 'Individual', |
522a26c9 | 1273 | 'table_name' => 'civicrm_contact', |
1274 | 'entity' => 'Contact', | |
1275 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1276 | 'localizable' => 0, |
c3fc2621 | 1277 | 'html' => [ |
e501603b | 1278 | 'type' => 'Select Date', |
24317d89 | 1279 | 'formatType' => 'birth', |
c3fc2621 | 1280 | ], |
a9d0587b | 1281 | 'add' => '1.1', |
c3fc2621 CW |
1282 | ], |
1283 | 'is_deceased' => [ | |
e501603b TO |
1284 | 'name' => 'is_deceased', |
1285 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 1286 | 'title' => ts('Deceased'), |
2cd5d411 | 1287 | 'required' => TRUE, |
c3fc2621 | 1288 | 'import' => TRUE, |
e501603b TO |
1289 | 'where' => 'civicrm_contact.is_deceased', |
1290 | 'headerPattern' => '/i(s\s)?d(eceased)$/i', | |
c3fc2621 | 1291 | 'export' => TRUE, |
f5c0f096 | 1292 | 'contactType' => 'Individual', |
45a83e42 | 1293 | 'default' => '0', |
522a26c9 | 1294 | 'table_name' => 'civicrm_contact', |
1295 | 'entity' => 'Contact', | |
1296 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1297 | 'localizable' => 0, |
c3fc2621 | 1298 | 'html' => [ |
e501603b | 1299 | 'type' => 'CheckBox', |
c3fc2621 | 1300 | ], |
a9d0587b | 1301 | 'add' => '1.1', |
c3fc2621 CW |
1302 | ], |
1303 | 'deceased_date' => [ | |
e501603b TO |
1304 | 'name' => 'deceased_date', |
1305 | 'type' => CRM_Utils_Type::T_DATE, | |
c3fc2621 | 1306 | 'title' => ts('Deceased Date'), |
215b423e | 1307 | 'description' => ts('Date of deceased'), |
c3fc2621 | 1308 | 'import' => TRUE, |
e501603b TO |
1309 | 'where' => 'civicrm_contact.deceased_date', |
1310 | 'headerPattern' => '/^deceased|(d(eceased\s)?date)$/i', | |
c3fc2621 | 1311 | 'export' => TRUE, |
f5c0f096 | 1312 | 'contactType' => 'Individual', |
522a26c9 | 1313 | 'table_name' => 'civicrm_contact', |
1314 | 'entity' => 'Contact', | |
1315 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1316 | 'localizable' => 0, |
c3fc2621 | 1317 | 'html' => [ |
e501603b | 1318 | 'type' => 'Select Date', |
24317d89 | 1319 | 'formatType' => 'birth', |
c3fc2621 | 1320 | ], |
a9d0587b | 1321 | 'add' => '1.5', |
c3fc2621 CW |
1322 | ], |
1323 | 'household_name' => [ | |
e501603b TO |
1324 | 'name' => 'household_name', |
1325 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1326 | 'title' => ts('Household Name'), |
215b423e | 1327 | 'description' => ts('Household Name.'), |
e501603b TO |
1328 | 'maxlength' => 128, |
1329 | 'size' => 30, | |
c3fc2621 | 1330 | 'import' => TRUE, |
e501603b TO |
1331 | 'where' => 'civicrm_contact.household_name', |
1332 | 'headerPattern' => '/^household|(h(ousehold\s)?name)$/i', | |
1333 | 'dataPattern' => '/^\w+$/', | |
c3fc2621 | 1334 | 'export' => TRUE, |
f5c0f096 | 1335 | 'contactType' => 'Household', |
522a26c9 | 1336 | 'table_name' => 'civicrm_contact', |
1337 | 'entity' => 'Contact', | |
1338 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1339 | 'localizable' => 0, |
c3fc2621 | 1340 | 'html' => [ |
e501603b | 1341 | 'type' => 'Text', |
c3fc2621 | 1342 | ], |
a9d0587b | 1343 | 'add' => '1.1', |
c3fc2621 CW |
1344 | ], |
1345 | 'primary_contact_id' => [ | |
e501603b TO |
1346 | 'name' => 'primary_contact_id', |
1347 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 1348 | 'title' => ts('Household Primary Contact ID'), |
215b423e | 1349 | 'description' => ts('Optional FK to Primary Contact for this household.'), |
a36434b9 | 1350 | 'where' => 'civicrm_contact.primary_contact_id', |
f5c0f096 | 1351 | 'contactType' => 'Household', |
522a26c9 | 1352 | 'table_name' => 'civicrm_contact', |
1353 | 'entity' => 'Contact', | |
1354 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1355 | 'localizable' => 0, |
e501603b | 1356 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
a9d0587b | 1357 | 'add' => '1.1', |
c3fc2621 CW |
1358 | ], |
1359 | 'organization_name' => [ | |
e501603b TO |
1360 | 'name' => 'organization_name', |
1361 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1362 | 'title' => ts('Organization Name'), |
215b423e | 1363 | 'description' => ts('Organization Name.'), |
e501603b TO |
1364 | 'maxlength' => 128, |
1365 | 'size' => 30, | |
c3fc2621 | 1366 | 'import' => TRUE, |
e501603b TO |
1367 | 'where' => 'civicrm_contact.organization_name', |
1368 | 'headerPattern' => '/^organization|(o(rganization\s)?name)$/i', | |
1369 | 'dataPattern' => '/^\w+$/', | |
c3fc2621 | 1370 | 'export' => TRUE, |
f5c0f096 | 1371 | 'contactType' => 'Organization', |
522a26c9 | 1372 | 'table_name' => 'civicrm_contact', |
1373 | 'entity' => 'Contact', | |
1374 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1375 | 'localizable' => 0, |
c3fc2621 | 1376 | 'html' => [ |
e501603b | 1377 | 'type' => 'Text', |
c3fc2621 | 1378 | ], |
a9d0587b | 1379 | 'add' => '1.1', |
c3fc2621 CW |
1380 | ], |
1381 | 'sic_code' => [ | |
e501603b TO |
1382 | 'name' => 'sic_code', |
1383 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1384 | 'title' => ts('Sic Code'), |
215b423e | 1385 | 'description' => ts('Standard Industry Classification Code.'), |
e501603b TO |
1386 | 'maxlength' => 8, |
1387 | 'size' => CRM_Utils_Type::EIGHT, | |
c3fc2621 | 1388 | 'import' => TRUE, |
e501603b TO |
1389 | 'where' => 'civicrm_contact.sic_code', |
1390 | 'headerPattern' => '/^sic|(s(ic\s)?code)$/i', | |
c3fc2621 | 1391 | 'export' => TRUE, |
f5c0f096 | 1392 | 'contactType' => 'Organization', |
522a26c9 | 1393 | 'table_name' => 'civicrm_contact', |
1394 | 'entity' => 'Contact', | |
1395 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1396 | 'localizable' => 0, |
c3fc2621 | 1397 | 'html' => [ |
e501603b | 1398 | 'type' => 'Text', |
c3fc2621 | 1399 | ], |
a9d0587b | 1400 | 'add' => '1.1', |
c3fc2621 CW |
1401 | ], |
1402 | 'user_unique_id' => [ | |
e501603b TO |
1403 | 'name' => 'user_unique_id', |
1404 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1405 | 'title' => ts('Unique ID (OpenID)'), |
215b423e | 1406 | 'description' => ts('the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM'), |
e501603b TO |
1407 | 'maxlength' => 255, |
1408 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 1409 | 'import' => TRUE, |
e501603b TO |
1410 | 'where' => 'civicrm_contact.user_unique_id', |
1411 | 'headerPattern' => '/^Open\s?ID|u(niq\w*)?\s?ID/i', | |
1412 | 'dataPattern' => '/^[\w\/\:\.]+$/', | |
c3fc2621 | 1413 | 'export' => TRUE, |
e501603b | 1414 | 'rule' => 'url', |
522a26c9 | 1415 | 'table_name' => 'civicrm_contact', |
1416 | 'entity' => 'Contact', | |
1417 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1418 | 'localizable' => 0, |
c3fc2621 | 1419 | 'html' => [ |
e501603b | 1420 | 'type' => 'Text', |
c3fc2621 | 1421 | ], |
a9d0587b | 1422 | 'add' => '2.0', |
c3fc2621 CW |
1423 | ], |
1424 | 'current_employer_id' => [ | |
e501603b TO |
1425 | 'name' => 'employer_id', |
1426 | 'type' => CRM_Utils_Type::T_INT, | |
a1d226d6 | 1427 | 'title' => ts('Current Employer ID'), |
215b423e | 1428 | 'description' => ts('OPTIONAL FK to civicrm_contact record.'), |
e501603b | 1429 | 'where' => 'civicrm_contact.employer_id', |
a36434b9 | 1430 | 'export' => TRUE, |
f5c0f096 | 1431 | 'contactType' => 'Individual', |
522a26c9 | 1432 | 'table_name' => 'civicrm_contact', |
1433 | 'entity' => 'Contact', | |
1434 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1435 | 'localizable' => 0, |
e501603b | 1436 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
c3fc2621 | 1437 | 'html' => [ |
e501603b | 1438 | 'type' => 'EntityRef', |
a1d226d6 | 1439 | 'label' => ts("Current Employer"), |
c3fc2621 | 1440 | ], |
a9d0587b | 1441 | 'add' => '2.1', |
c3fc2621 CW |
1442 | ], |
1443 | 'contact_is_deleted' => [ | |
e501603b TO |
1444 | 'name' => 'is_deleted', |
1445 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 CW |
1446 | 'title' => ts('Contact is in Trash'), |
1447 | 'required' => TRUE, | |
e501603b | 1448 | 'where' => 'civicrm_contact.is_deleted', |
a36434b9 | 1449 | 'export' => TRUE, |
d2ff128c CW |
1450 | 'permission' => [ |
1451 | 'access deleted contacts', | |
1452 | ], | |
45a83e42 | 1453 | 'default' => '0', |
522a26c9 | 1454 | 'table_name' => 'civicrm_contact', |
1455 | 'entity' => 'Contact', | |
1456 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1457 | 'localizable' => 0, |
c3fc2621 | 1458 | 'html' => [ |
e501603b | 1459 | 'type' => 'CheckBox', |
c3fc2621 | 1460 | ], |
a9d0587b | 1461 | 'add' => '3.2', |
c3fc2621 CW |
1462 | ], |
1463 | 'created_date' => [ | |
e501603b TO |
1464 | 'name' => 'created_date', |
1465 | 'type' => CRM_Utils_Type::T_TIMESTAMP, | |
c3fc2621 | 1466 | 'title' => ts('Created Date'), |
215b423e | 1467 | 'description' => ts('When was the contact was created.'), |
c3fc2621 | 1468 | 'required' => FALSE, |
e501603b | 1469 | 'where' => 'civicrm_contact.created_date', |
a36434b9 | 1470 | 'export' => TRUE, |
e501603b | 1471 | 'default' => 'NULL', |
522a26c9 | 1472 | 'table_name' => 'civicrm_contact', |
1473 | 'entity' => 'Contact', | |
1474 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1475 | 'localizable' => 0, |
a9d0587b | 1476 | 'add' => '4.3', |
c3fc2621 CW |
1477 | ], |
1478 | 'modified_date' => [ | |
e501603b TO |
1479 | 'name' => 'modified_date', |
1480 | 'type' => CRM_Utils_Type::T_TIMESTAMP, | |
c3fc2621 | 1481 | 'title' => ts('Modified Date'), |
215b423e | 1482 | 'description' => ts('When was the contact (or closely related entity) was created or modified or deleted.'), |
c3fc2621 | 1483 | 'required' => FALSE, |
e501603b | 1484 | 'where' => 'civicrm_contact.modified_date', |
a36434b9 | 1485 | 'export' => TRUE, |
e501603b | 1486 | 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', |
522a26c9 | 1487 | 'table_name' => 'civicrm_contact', |
1488 | 'entity' => 'Contact', | |
1489 | 'bao' => 'CRM_Contact_BAO_Contact', | |
6a7e5e5d | 1490 | 'localizable' => 0, |
a9d0587b | 1491 | 'add' => '4.3', |
c3fc2621 CW |
1492 | ], |
1493 | ]; | |
346aaaba | 1494 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 1495 | } |
346aaaba | 1496 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 1497 | } |
c3fc2621 | 1498 | |
e501603b | 1499 | /** |
bd8e0b14 | 1500 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
1501 | * |
1502 | * @return array | |
bd8e0b14 | 1503 | * Array(string $name => string $uniqueName). |
e501603b | 1504 | */ |
c3fc2621 | 1505 | public static function &fieldKeys() { |
bd8e0b14 TO |
1506 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
1507 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 1508 | } |
bd8e0b14 | 1509 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 1510 | } |
c3fc2621 | 1511 | |
e501603b TO |
1512 | /** |
1513 | * Returns the names of this table | |
1514 | * | |
1515 | * @return string | |
1516 | */ | |
c3fc2621 | 1517 | public static function getTableName() { |
e501603b TO |
1518 | return self::$_tableName; |
1519 | } | |
c3fc2621 | 1520 | |
e501603b TO |
1521 | /** |
1522 | * Returns if this table needs to be logged | |
1523 | * | |
c3fc2621 | 1524 | * @return bool |
e501603b | 1525 | */ |
c3fc2621 | 1526 | public function getLog() { |
e501603b TO |
1527 | return self::$_log; |
1528 | } | |
c3fc2621 | 1529 | |
e501603b TO |
1530 | /** |
1531 | * Returns the list of fields that can be imported | |
1532 | * | |
1533 | * @param bool $prefix | |
1534 | * | |
1535 | * @return array | |
1536 | */ | |
c3fc2621 CW |
1537 | public static function &import($prefix = FALSE) { |
1538 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contact', $prefix, []); | |
60808919 | 1539 | return $r; |
e501603b | 1540 | } |
c3fc2621 | 1541 | |
e501603b TO |
1542 | /** |
1543 | * Returns the list of fields that can be exported | |
1544 | * | |
1545 | * @param bool $prefix | |
1546 | * | |
1547 | * @return array | |
1548 | */ | |
c3fc2621 CW |
1549 | public static function &export($prefix = FALSE) { |
1550 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contact', $prefix, []); | |
60808919 | 1551 | return $r; |
e501603b | 1552 | } |
c3fc2621 | 1553 | |
e7a6b91a AS |
1554 | /** |
1555 | * Returns the list of indices | |
c3fc2621 CW |
1556 | * |
1557 | * @param bool $localize | |
1558 | * | |
1559 | * @return array | |
e7a6b91a AS |
1560 | */ |
1561 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
1562 | $indices = [ |
1563 | 'index_contact_type' => [ | |
e7a6b91a | 1564 | 'name' => 'index_contact_type', |
c3fc2621 | 1565 | 'field' => [ |
e7a6b91a | 1566 | 0 => 'contact_type', |
c3fc2621 CW |
1567 | ], |
1568 | 'localizable' => FALSE, | |
e7a6b91a | 1569 | 'sig' => 'civicrm_contact::0::contact_type', |
c3fc2621 CW |
1570 | ], |
1571 | 'index_contact_sub_type' => [ | |
e7a6b91a | 1572 | 'name' => 'index_contact_sub_type', |
c3fc2621 | 1573 | 'field' => [ |
e7a6b91a | 1574 | 0 => 'contact_sub_type', |
c3fc2621 CW |
1575 | ], |
1576 | 'localizable' => FALSE, | |
e7a6b91a | 1577 | 'sig' => 'civicrm_contact::0::contact_sub_type', |
c3fc2621 CW |
1578 | ], |
1579 | 'UI_external_identifier' => [ | |
e7a6b91a | 1580 | 'name' => 'UI_external_identifier', |
c3fc2621 | 1581 | 'field' => [ |
e7a6b91a | 1582 | 0 => 'external_identifier', |
c3fc2621 CW |
1583 | ], |
1584 | 'localizable' => FALSE, | |
1585 | 'unique' => TRUE, | |
e7a6b91a | 1586 | 'sig' => 'civicrm_contact::1::external_identifier', |
c3fc2621 CW |
1587 | ], |
1588 | 'index_sort_name' => [ | |
e7a6b91a | 1589 | 'name' => 'index_sort_name', |
c3fc2621 | 1590 | 'field' => [ |
e7a6b91a | 1591 | 0 => 'sort_name', |
c3fc2621 CW |
1592 | ], |
1593 | 'localizable' => FALSE, | |
e7a6b91a | 1594 | 'sig' => 'civicrm_contact::0::sort_name', |
c3fc2621 CW |
1595 | ], |
1596 | 'index_preferred_communication_method' => [ | |
e7a6b91a | 1597 | 'name' => 'index_preferred_communication_method', |
c3fc2621 | 1598 | 'field' => [ |
e7a6b91a | 1599 | 0 => 'preferred_communication_method', |
c3fc2621 CW |
1600 | ], |
1601 | 'localizable' => FALSE, | |
e7a6b91a | 1602 | 'sig' => 'civicrm_contact::0::preferred_communication_method', |
c3fc2621 CW |
1603 | ], |
1604 | 'index_hash' => [ | |
e7a6b91a | 1605 | 'name' => 'index_hash', |
c3fc2621 | 1606 | 'field' => [ |
e7a6b91a | 1607 | 0 => 'hash', |
c3fc2621 CW |
1608 | ], |
1609 | 'localizable' => FALSE, | |
e7a6b91a | 1610 | 'sig' => 'civicrm_contact::0::hash', |
c3fc2621 CW |
1611 | ], |
1612 | 'index_api_key' => [ | |
e7a6b91a | 1613 | 'name' => 'index_api_key', |
c3fc2621 | 1614 | 'field' => [ |
e7a6b91a | 1615 | 0 => 'api_key', |
c3fc2621 CW |
1616 | ], |
1617 | 'localizable' => FALSE, | |
e7a6b91a | 1618 | 'sig' => 'civicrm_contact::0::api_key', |
c3fc2621 CW |
1619 | ], |
1620 | 'index_first_name' => [ | |
e7a6b91a | 1621 | 'name' => 'index_first_name', |
c3fc2621 | 1622 | 'field' => [ |
e7a6b91a | 1623 | 0 => 'first_name', |
c3fc2621 CW |
1624 | ], |
1625 | 'localizable' => FALSE, | |
e7a6b91a | 1626 | 'sig' => 'civicrm_contact::0::first_name', |
c3fc2621 CW |
1627 | ], |
1628 | 'index_last_name' => [ | |
e7a6b91a | 1629 | 'name' => 'index_last_name', |
c3fc2621 | 1630 | 'field' => [ |
e7a6b91a | 1631 | 0 => 'last_name', |
c3fc2621 CW |
1632 | ], |
1633 | 'localizable' => FALSE, | |
e7a6b91a | 1634 | 'sig' => 'civicrm_contact::0::last_name', |
c3fc2621 CW |
1635 | ], |
1636 | 'UI_prefix' => [ | |
e7a6b91a | 1637 | 'name' => 'UI_prefix', |
c3fc2621 | 1638 | 'field' => [ |
e7a6b91a | 1639 | 0 => 'prefix_id', |
c3fc2621 CW |
1640 | ], |
1641 | 'localizable' => FALSE, | |
e7a6b91a | 1642 | 'sig' => 'civicrm_contact::0::prefix_id', |
c3fc2621 CW |
1643 | ], |
1644 | 'UI_suffix' => [ | |
e7a6b91a | 1645 | 'name' => 'UI_suffix', |
c3fc2621 | 1646 | 'field' => [ |
e7a6b91a | 1647 | 0 => 'suffix_id', |
c3fc2621 CW |
1648 | ], |
1649 | 'localizable' => FALSE, | |
e7a6b91a | 1650 | 'sig' => 'civicrm_contact::0::suffix_id', |
c3fc2621 CW |
1651 | ], |
1652 | 'index_communication_style_id' => [ | |
e7a6b91a | 1653 | 'name' => 'index_communication_style_id', |
c3fc2621 | 1654 | 'field' => [ |
e7a6b91a | 1655 | 0 => 'communication_style_id', |
c3fc2621 CW |
1656 | ], |
1657 | 'localizable' => FALSE, | |
e7a6b91a | 1658 | 'sig' => 'civicrm_contact::0::communication_style_id', |
c3fc2621 CW |
1659 | ], |
1660 | 'UI_gender' => [ | |
e7a6b91a | 1661 | 'name' => 'UI_gender', |
c3fc2621 | 1662 | 'field' => [ |
e7a6b91a | 1663 | 0 => 'gender_id', |
c3fc2621 CW |
1664 | ], |
1665 | 'localizable' => FALSE, | |
e7a6b91a | 1666 | 'sig' => 'civicrm_contact::0::gender_id', |
c3fc2621 CW |
1667 | ], |
1668 | 'index_is_deceased' => [ | |
27633545 | 1669 | 'name' => 'index_is_deceased', |
c3fc2621 | 1670 | 'field' => [ |
27633545 | 1671 | 0 => 'is_deceased', |
c3fc2621 CW |
1672 | ], |
1673 | 'localizable' => FALSE, | |
27633545 | 1674 | 'sig' => 'civicrm_contact::0::is_deceased', |
c3fc2621 CW |
1675 | ], |
1676 | 'index_household_name' => [ | |
e7a6b91a | 1677 | 'name' => 'index_household_name', |
c3fc2621 | 1678 | 'field' => [ |
e7a6b91a | 1679 | 0 => 'household_name', |
c3fc2621 CW |
1680 | ], |
1681 | 'localizable' => FALSE, | |
e7a6b91a | 1682 | 'sig' => 'civicrm_contact::0::household_name', |
c3fc2621 CW |
1683 | ], |
1684 | 'index_organization_name' => [ | |
e7a6b91a | 1685 | 'name' => 'index_organization_name', |
c3fc2621 | 1686 | 'field' => [ |
e7a6b91a | 1687 | 0 => 'organization_name', |
c3fc2621 CW |
1688 | ], |
1689 | 'localizable' => FALSE, | |
e7a6b91a | 1690 | 'sig' => 'civicrm_contact::0::organization_name', |
c3fc2621 CW |
1691 | ], |
1692 | 'index_is_deleted_sort_name' => [ | |
e7a6b91a | 1693 | 'name' => 'index_is_deleted_sort_name', |
c3fc2621 | 1694 | 'field' => [ |
e7a6b91a AS |
1695 | 0 => 'is_deleted', |
1696 | 1 => 'sort_name', | |
1697 | 2 => 'id', | |
c3fc2621 CW |
1698 | ], |
1699 | 'localizable' => FALSE, | |
e7a6b91a | 1700 | 'sig' => 'civicrm_contact::0::is_deleted::sort_name::id', |
c3fc2621 | 1701 | ], |
11e5567f | 1702 | 'index_created_date' => [ |
1703 | 'name' => 'index_created_date', | |
1704 | 'field' => [ | |
1705 | 0 => 'created_date', | |
1706 | ], | |
1707 | 'localizable' => FALSE, | |
1708 | 'sig' => 'civicrm_contact::0::created_date', | |
1709 | ], | |
1710 | 'index_modified_date' => [ | |
1711 | 'name' => 'index_modified_date', | |
1712 | 'field' => [ | |
1713 | 0 => 'modified_date', | |
1714 | ], | |
1715 | 'localizable' => FALSE, | |
1716 | 'sig' => 'civicrm_contact::0::modified_date', | |
1717 | ], | |
c3fc2621 | 1718 | ]; |
e7a6b91a AS |
1719 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
1720 | } | |
c3fc2621 | 1721 | |
e501603b | 1722 | } |