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['Account'] = array('table' => 'accounts', 'audited'=>true, 'unified_search' => true, 'unified_search_default_enabled' => true, 'duplicate_merge'=>true,
39 'comment' => 'Accounts are organizations or entities that are the target of selling, support, and marketing activities, or have already purchased products or services',
44 'name' => 'parent_id',
45 'vname' => 'LBL_PARENT_ACCOUNT_ID',
50 'comment' => 'Account ID of the parent of this account',
56 'vname' => 'LBL_SIC_CODE',
59 'comment' => 'SIC code of the account',
65 'name' => 'parent_name',
67 'id_name' => 'parent_id',
68 'vname' => 'LBL_MEMBER_OF',
71 'module' => 'Accounts',
72 'table' => 'accounts',
73 'massupdate' => false,
77 'unified_search' => true,
78 'importable' => 'true',
86 'relationship' => 'member_accounts',
88 'bean_name'=>'Account',
90 'vname'=>'LBL_MEMBERS',
94 'name' => 'member_of',
96 'relationship' => 'member_accounts',
98 'bean_name'=>'Account',
101 'vname'=>'LBL_MEMBER_OF',
106 'name' => 'email_opt_out',
107 'vname' => 'LBL_EMAIL_OPT_OUT',
108 'source' => 'non-db',
110 'massupdate' => false,
115 'name' => 'invalid_email',
116 'vname' => 'LBL_INVALID_EMAIL',
117 'source' => 'non-db',
119 'massupdate' => false,
126 'relationship' => 'account_cases',
128 'bean_name'=>'aCase',
130 'vname'=>'LBL_CASES',
136 'relationship' => 'account_tasks',
140 'vname'=>'LBL_TASKS',
146 'relationship' => 'account_notes',
150 'vname'=>'LBL_NOTES',
154 'name' => 'meetings',
156 'relationship' => 'account_meetings',
157 'module'=>'Meetings',
158 'bean_name'=>'Meeting',
160 'vname'=>'LBL_MEETINGS',
166 'relationship' => 'account_calls',
170 'vname'=>'LBL_CALLS',
177 'relationship' => 'emails_accounts_rel', /* reldef in emails */
179 'bean_name'=>'Email',
181 'vname'=>'LBL_EMAILS',
185 'name' => 'documents',
187 'relationship' => 'documents_accounts',
188 'source' => 'non-db',
189 'vname' => 'LBL_DOCUMENTS_SUBPANEL_TITLE',
195 'relationship' => 'accounts_bugs',
203 'name' => 'contacts',
205 'relationship' => 'accounts_contacts',
206 'module'=>'Contacts',
207 'bean_name'=>'Contact',
209 'vname'=>'LBL_CONTACTS',
213 'name' => 'email_addresses',
215 'relationship' => 'accounts_email_addresses',
216 'source' => 'non-db',
217 'vname' => 'LBL_EMAIL_ADDRESSES',
219 'unified_search' => true,
220 'rel_fields' => array('primary_address' => array('type'=>'bool')),
222 'email_addresses_primary' =>
224 'name' => 'email_addresses_primary',
226 'relationship' => 'accounts_email_addresses_primary',
227 'source' => 'non-db',
228 'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
229 'duplicate_merge'=> 'disabled',
233 'name' => 'opportunities',
235 'relationship' => 'accounts_opportunities',
236 'module'=>'Opportunities',
237 'bean_name'=>'Opportunity',
239 'vname'=>'LBL_OPPORTUNITY',
247 'relationship' => 'projects_accounts',
249 'bean_name'=>'Project',
251 'vname'=>'LBL_PROJECTS',
257 'relationship' => 'account_leads',
261 'vname'=>'LBL_LEADS',
265 'name' => 'campaigns',
267 'relationship' => 'account_campaign_log',
268 'module'=>'CampaignLog',
269 'bean_name'=>'CampaignLog',
271 'vname'=>'LBL_CAMPAIGNLOG',
273 'campaign_accounts' =>
275 'name' => 'campaign_accounts',
277 'vname' => 'LBL_CAMPAIGNS',
278 'relationship' => 'campaign_accounts',
279 'source' => 'non-db',
284 'name' => 'created_by_link',
286 'relationship' => 'accounts_created_by',
287 'vname' => 'LBL_CREATED_BY_USER',
288 'link_type' => 'one',
293 'modified_user_link' =>
295 'name' => 'modified_user_link',
297 'relationship' => 'accounts_modified_user',
298 'vname' => 'LBL_MODIFIED_BY_USER',
299 'link_type' => 'one',
304 'assigned_user_link' =>
306 'name' => 'assigned_user_link',
308 'relationship' => 'accounts_assigned_user',
309 'vname' => 'LBL_ASSIGNED_TO_USER',
310 'link_type' => 'one',
314 'duplicate_merge'=>'enabled',
315 'rname' => 'user_name',
316 'id_name' => 'assigned_user_id',
321 'name' => 'products',
323 'relationship' => 'products_accounts',
324 'source' => 'non-db',
325 'vname' => 'LBL_PRODUCTS',
330 'name' => 'campaign_id',
331 'comment' => 'Campaign that generated Account',
332 'vname'=>'LBL_CAMPAIGN_ID',
334 'id_name' => 'campaign_id',
336 'table' => 'campaigns',
338 'module' => 'Campaigns',
340 'massupdate' => false,
341 'duplicate_merge'=> 'disabled',
346 'name'=>'campaign_name',
348 'vname' => 'LBL_CAMPAIGN',
352 'table' => 'campaigns',
353 'id_name' => 'campaign_id',
354 'link' => 'campaign_accounts',
355 'module'=>'Campaigns',
356 'duplicate_merge'=>'disabled',
357 'comment' => 'The first campaign name for Account (Meta-data only)',
362 'name' => 'prospect_lists',
364 'relationship' => 'prospect_list_accounts',
365 'module'=>'ProspectLists',
367 'vname'=>'LBL_PROSPECT_LIST',
370 , 'indices' => array (
371 array('name' =>'idx_accnt_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')),
372 array('name' =>'idx_accnt_name_del', 'type' => 'index', 'fields'=>array('name', 'deleted')),//bug #5530
373 array('name' =>'idx_accnt_assigned_del', 'type' =>'index', 'fields'=>array( 'deleted', 'assigned_user_id')),
374 array('name' =>'idx_accnt_parent_id', 'type' =>'index', 'fields'=>array( 'parent_id')),
377 , 'relationships' => array (
378 'member_accounts' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
379 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'parent_id',
380 'relationship_type'=>'one-to-many')
382 ,'account_cases' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
383 'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'account_id',
384 'relationship_type'=>'one-to-many')
386 ,'account_tasks' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
387 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
388 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
389 'relationship_role_column_value'=>'Accounts')
391 ,'account_notes' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
392 'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
393 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
394 'relationship_role_column_value'=>'Accounts')
396 ,'account_meetings' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
397 'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'parent_id',
398 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
399 'relationship_role_column_value'=>'Accounts')
401 ,'account_calls' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
402 'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
403 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
404 'relationship_role_column_value'=>'Accounts')
406 /*,'accounts_emails' => array(
407 'rhs_module' => 'Emails',
408 'rhs_table' => 'emails',
410 'lhs_module' => 'Accounts',
411 'lhs_table' => 'accounts',
413 'relationship_type' => 'many-to-many',
414 'join_table' => 'emails_accounts',
415 'join_key_rhs' => 'email_id',
416 'join_key_lhs' => 'account_id'
419 ,'account_emails' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
420 'rhs_module'=> 'Emails', 'rhs_table'=> 'emails', 'rhs_key' => 'parent_id',
421 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
422 'relationship_role_column_value'=>'Accounts')
424 ,'account_leads' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
425 'rhs_module'=> 'Leads', 'rhs_table'=> 'leads', 'rhs_key' => 'account_id',
426 'relationship_type'=>'one-to-many')
429 'accounts_assigned_user' =>
430 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
431 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'assigned_user_id',
432 'relationship_type'=>'one-to-many'),
434 'accounts_modified_user' =>
435 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
436 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'modified_user_id',
437 'relationship_type'=>'one-to-many'),
439 'accounts_created_by' =>
440 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
441 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'created_by',
442 'relationship_type'=>'one-to-many'),
444 'account_campaign_log' => array('lhs_module' => 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key'=> 'id',
445 'rhs_module'=> 'CampaignLog','rhs_table'=>'campaign_log', 'rhs_key'=> 'target_id',
446 'relationship_type' =>'one-to-many'),
449 //This enables optimistic locking for Saves From EditView
450 'optimistic_locking'=>true,
453 VardefManager::createVardef('Accounts','Account', array('default', 'assignable',
457 //jc - adding for refactor for import to not use the required_fields array
458 //defined in the field_arrays.php file
459 $dictionary['Account']['fields']['name']['importable'] = 'required';