2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
38 $dictionary['Contact'] = array('table' => 'contacts', 'audited'=>true,
40 'unified_search' => true, 'unified_search_default_enabled' => true, 'duplicate_merge'=>true, 'fields' =>
45 'name' => 'email_and_name1',
46 'rname' => 'email_and_name1',
47 'vname' => 'LBL_NAME',
51 'importable' => 'false',
55 'name' => 'lead_source',
56 'vname' => 'LBL_LEAD_SOURCE',
58 'options' => 'lead_source_dom',
60 'comment' => 'How did the contact come about',
65 'name' => 'account_name',
67 'id_name' => 'account_id',
68 'vname' => 'LBL_ACCOUNT_NAME',
69 'join_name'=>'accounts',
72 'table' => 'accounts',
74 'module' => 'Accounts',
75 'dbType' => 'varchar',
78 'unified_search' => true,
82 'name' => 'account_id',
84 'id_name' => 'account_id',
85 'vname' => 'LBL_ACCOUNT_ID',
87 'table' => 'accounts',
89 'module' => 'Accounts',
93 'massupdate' => false,
94 'duplicate_merge'=> 'disabled',
98 'opportunity_role_fields' =>
100 'name' => 'opportunity_role_fields',
102 'relationship_fields'=>array('id' => 'opportunity_role_id', 'contact_role' => 'opportunity_role'),
103 'vname' => 'LBL_ACCOUNT_NAME',
105 'link' => 'opportunities',
106 'link_type' => 'relationship_info',
107 'join_link_name' => 'opportunities_contacts',
108 'source' => 'non-db',
109 'importable' => 'false',
110 'duplicate_merge'=> 'disabled',
111 'studio' => array('listview' => false),
113 'opportunity_role_id' =>
115 'name' => 'opportunity_role_id',
117 'source' => 'non-db',
118 'vname' => 'LBL_OPPORTUNITY_ROLE_ID',
119 'studio' => array('listview' => false),
121 'opportunity_role' =>
123 'name' => 'opportunity_role',
125 'source' => 'non-db',
126 'vname' => 'LBL_OPPORTUNITY_ROLE',
127 'options' => 'opportunity_relationship_type_dom',
131 'name' => 'reports_to_id',
132 'vname' => 'LBL_REPORTS_TO_ID',
136 'comment' => 'The contact this contact reports to'
140 'name' => 'report_to_name',
141 'rname' => 'last_name',
142 'id_name' => 'reports_to_id',
143 'vname' => 'LBL_REPORTS_TO',
145 'link' => 'reports_to_link',
146 'table' => 'contacts',
148 'module' => 'Contacts',
149 'dbType' => 'varchar',
152 'source' => 'non-db',
156 'name' => 'birthdate',
157 'vname' => 'LBL_BIRTHDATE',
158 'massupdate' => false,
160 'comment' => 'The birthdate of the contact'
164 'name' => 'accounts',
166 'relationship' => 'accounts_contacts',
167 'link_type' => 'one',
168 'source' => 'non-db',
169 'vname' => 'LBL_ACCOUNT',
170 'duplicate_merge'=> 'disabled',
174 'name' => 'reports_to_link',
176 'relationship' => 'contact_direct_reports',
177 'link_type' => 'one',
179 'source' => 'non-db',
180 'vname' => 'LBL_REPORTS_TO',
184 'name' => 'opportunities',
186 'relationship' => 'opportunities_contacts',
187 'source' => 'non-db',
188 'module' => 'Opportunities',
189 'bean_name' => 'Opportunity',
190 'vname' => 'LBL_OPPORTUNITIES',
194 'name' => 'email_addresses',
196 'relationship' => 'contacts_email_addresses',
197 'module' => 'EmailAddress',
198 'bean_name'=>'EmailAddress',
199 'source' => 'non-db',
200 'vname' => 'LBL_EMAIL_ADDRESSES',
202 'rel_fields' => array('primary_address' => array('type'=>'bool')),
203 'unified_search'=>true,
205 'email_addresses_primary' =>
207 'name' => 'email_addresses_primary',
209 'relationship' => 'contacts_email_addresses_primary',
210 'source' => 'non-db',
211 'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
212 'duplicate_merge'=> 'disabled',
218 'relationship' => 'contacts_bugs',
219 'source' => 'non-db',
220 'vname' => 'LBL_BUGS',
226 'relationship' => 'calls_contacts',
227 'source' => 'non-db',
228 'vname' => 'LBL_CALLS',
234 'relationship' => 'contacts_cases',
235 'source' => 'non-db',
236 'vname' => 'LBL_CASES',
240 'name' => 'direct_reports',
242 'relationship' => 'contact_direct_reports',
243 'source' => 'non-db',
244 'vname' => 'LBL_DIRECT_REPORTS',
250 'relationship' => 'emails_contacts_rel',
251 'source' => 'non-db',
252 'vname' => 'LBL_EMAILS',
256 'name' => 'documents',
258 'relationship' => 'documents_contacts',
259 'source' => 'non-db',
260 'vname' => 'LBL_DOCUMENTS_SUBPANEL_TITLE',
266 'relationship' => 'contact_leads',
267 'source' => 'non-db',
268 'vname' => 'LBL_LEADS',
272 'name' => 'meetings',
274 'relationship' => 'meetings_contacts',
275 'source' => 'non-db',
276 'vname' => 'LBL_MEETINGS',
282 'relationship' => 'contact_notes',
283 'source' => 'non-db',
284 'vname' => 'LBL_NOTES',
290 'relationship' => 'projects_contacts',
291 'source' => 'non-db',
292 'vname' => 'LBL_PROJECTS',
296 'name' => 'project_resource',
298 'relationship' => 'projects_contacts_resources',
299 'source' => 'non-db',
300 'vname' => 'LBL_PROJECTS',
309 'relationship' => 'contact_tasks',
310 'source' => 'non-db',
311 'vname' => 'LBL_TASKS',
315 'name' => 'tasks_parent',
317 'relationship' => 'contact_tasks_parent',
318 'source' => 'non-db',
319 'vname' => 'LBL_TASKS',
323 'name' => 'user_sync',
325 'relationship' => 'contacts_users',
326 'source' => 'non-db',
327 'vname' => 'LBL_USER_SYNC',
331 'name' => 'created_by_link',
333 'relationship' => 'contacts_created_by',
334 'vname' => 'LBL_CREATED_BY_USER',
335 'link_type' => 'one',
337 'bean_name' => 'User',
338 'source' => 'non-db',
340 'modified_user_link' =>
342 'name' => 'modified_user_link',
344 'relationship' => 'contacts_modified_user',
345 'vname' => 'LBL_MODIFIED_BY_USER',
346 'link_type' => 'one',
348 'bean_name' => 'User',
349 'source' => 'non-db',
351 'assigned_user_link' =>
353 'name' => 'assigned_user_link',
355 'relationship' => 'contacts_assigned_user',
356 'vname' => 'LBL_ASSIGNED_TO_USER',
357 'link_type' => 'one',
359 'bean_name' => 'User',
360 'source' => 'non-db',
361 'rname' => 'user_name',
362 'id_name' => 'assigned_user_id',
364 'duplicate_merge'=>'enabled'
368 'name' => 'campaign_id',
369 'comment' => 'Campaign that generated lead',
370 'vname'=>'LBL_CAMPAIGN_ID',
372 'id_name' => 'campaign_id',
374 //'dbType' => 'char',
375 'table' => 'campaigns',
377 'module' => 'Campaigns',
378 // 'reportable'=>false,
379 'massupdate' => false,
380 'duplicate_merge'=> 'disabled',
385 'name' => 'campaign_name',
387 'vname' => 'LBL_CAMPAIGN',
389 'link' => 'campaign_contacts',
393 'table' => 'campaigns',
394 'id_name' => 'campaign_id',
395 'module'=>'Campaigns',
396 'duplicate_merge'=>'disabled',
397 'comment' => 'The first campaign name for Contact (Meta-data only)',
402 'name' => 'campaigns',
404 'relationship' => 'contact_campaign_log',
405 'module'=>'CampaignLog',
406 'bean_name'=>'CampaignLog',
408 'vname'=>'LBL_CAMPAIGNLOG',
411 'campaign_contacts' =>
413 'name' => 'campaign_contacts',
415 'vname' => 'LBL_CAMPAIGN_CONTACT',
416 'relationship' => 'campaign_contacts',
417 'source' => 'non-db',
419 'c_accept_status_fields' =>
421 'name' => 'c_accept_status_fields',
423 'relationship_fields'=>array('id' => 'accept_status_id', 'accept_status' => 'accept_status_name'),
424 'vname' => 'LBL_LIST_ACCEPT_STATUS',
427 'link_type' => 'relationship_info',
428 'source' => 'non-db',
429 'importable' => 'false',
430 'duplicate_merge'=> 'disabled',
431 'studio' => array('listview' => false),
433 'm_accept_status_fields' =>
435 'name' => 'm_accept_status_fields',
437 'relationship_fields'=>array('id' => 'accept_status_id', 'accept_status' => 'accept_status_name'),
438 'vname' => 'LBL_LIST_ACCEPT_STATUS',
440 'link' => 'meetings',
441 'link_type' => 'relationship_info',
442 'source' => 'non-db',
443 'importable' => 'false',
445 'duplicate_merge'=> 'disabled',
446 'studio' => array('listview' => false),
448 'accept_status_id' =>
450 'name' => 'accept_status_id',
452 'source' => 'non-db',
453 'vname' => 'LBL_LIST_ACCEPT_STATUS',
454 'studio' => array('listview' => false),
456 'accept_status_name' =>
458 'massupdate' => false,
459 'name' => 'accept_status_name',
462 'source' => 'non-db',
463 'vname' => 'LBL_LIST_ACCEPT_STATUS',
464 'options' => 'dom_meeting_accept_status',
465 'importable' => 'false',
469 'name' => 'prospect_lists',
471 'relationship' => 'prospect_list_contacts',
472 'module'=>'ProspectLists',
474 'vname'=>'LBL_PROSPECT_LIST',
478 'massupdate' => false,
479 'name' => 'sync_contact',
480 'vname' => 'LBL_SYNC_CONTACT',
482 'source' => 'non-db',
483 'comment' => 'Synch to outlook? (Meta-Data only)',
489 'name' => 'idx_cont_last_first',
491 'fields' => array('last_name', 'first_name', 'deleted')
494 'name' => 'idx_contacts_del_last',
496 'fields' => array('deleted', 'last_name'),
499 'name' => 'idx_cont_del_reports',
501 'fields'=>array('deleted', 'reports_to_id', 'last_name')
504 'name' => 'idx_reports_to_id',
506 'fields'=> array('reports_to_id'),
509 'name' => 'idx_del_id_user',
511 'fields'=> array('deleted', 'id', 'assigned_user_id'),
514 'name' => 'idx_cont_assigned',
516 'fields' => array('assigned_user_id')
519 // 'name' => 'idx_cont_email1',
520 // 'type' => 'index',
521 // 'fields' => array('email1')
524 // 'name' => 'idx_cont_email2',
525 // 'type' => 'index',
526 // 'fields' => array('email2')
529 'relationships' => array(
530 'contact_direct_reports' => array('lhs_module' => 'Contacts',
531 'lhs_table' => 'contacts',
533 'rhs_module' => 'Contacts',
534 'rhs_table' => 'contacts',
535 'rhs_key' => 'reports_to_id',
536 'relationship_type' => 'one-to-many'),
537 'contact_leads' => array('lhs_module' => 'Contacts',
538 'lhs_table' => 'contacts',
540 'rhs_module' => 'Leads',
541 'rhs_table' => 'leads',
542 'rhs_key' => 'contact_id',
543 'relationship_type' => 'one-to-many'),
544 'contact_notes' => array('lhs_module' => 'Contacts',
545 'lhs_table' => 'contacts',
547 'rhs_module' => 'Notes',
548 'rhs_table' => 'notes',
549 'rhs_key' => 'contact_id',
550 'relationship_type' => 'one-to-many'),
551 'contact_tasks' => array('lhs_module' => 'Contacts',
552 'lhs_table' => 'contacts',
554 'rhs_module' => 'Tasks',
555 'rhs_table' => 'tasks',
556 'rhs_key' => 'contact_id',
557 'relationship_type' => 'one-to-many'),
558 'contact_tasks_parent' => array('lhs_module' => 'Contacts',
559 'lhs_table' => 'contacts',
561 'rhs_module' => 'Tasks',
562 'rhs_table' => 'tasks',
563 'rhs_key' => 'parent_id',
564 'relationship_type' => 'one-to-many',
565 'relationship_role_column'=>'parent_type',
566 'relationship_role_column_value'=>'Contacts'
568 'contacts_assigned_user' => array('lhs_module' => 'Users',
569 'lhs_table' => 'users',
571 'rhs_module' => 'Contacts',
572 'rhs_table' => 'contacts',
573 'rhs_key' => 'assigned_user_id',
574 'relationship_type' => 'one-to-many'),
575 'contacts_modified_user' => array('lhs_module' => 'Users',
576 'lhs_table' => 'users',
578 'rhs_module' => 'Contacts',
579 'rhs_table' => 'contacts',
580 'rhs_key' => 'modified_user_id',
581 'relationship_type' => 'one-to-many'),
582 'contacts_created_by' => array('lhs_module' => 'Users',
583 'lhs_table' => 'users',
585 'rhs_module' => 'Contacts',
586 'rhs_table' => 'contacts',
587 'rhs_key' => 'created_by',
588 'relationship_type' => 'one-to-many'),
589 'contact_campaign_log' => array(
590 'lhs_module' => 'Contacts',
591 'lhs_table' => 'contacts',
593 'rhs_module' => 'CampaignLog',
594 'rhs_table' => 'campaign_log',
595 'rhs_key' => 'target_id',
596 'relationship_type' =>'one-to-many'
600 //This enables optimistic locking for Saves From EditView
601 'optimistic_locking'=>true,
604 VardefManager::createVardef('Contacts','Contact', array('default', 'assignable',