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