2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM 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, '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',
70 'table' => 'parent_accounts',
72 'module' => 'Accounts',
73 'massupdate' => false,
77 'unified_search' => true,
78 'importable' => 'false',
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',
187 'relationship' => 'accounts_bugs',
195 'name' => 'contacts',
197 'relationship' => 'accounts_contacts',
198 'module'=>'Contacts',
199 'bean_name'=>'Contact',
201 'vname'=>'LBL_CONTACTS',
205 'name' => 'email_addresses',
207 'relationship' => 'accounts_email_addresses',
208 'source' => 'non-db',
209 'vname' => 'LBL_EMAIL_ADDRESSES',
211 'unified_search' => true,
212 'rel_fields' => array('primary_address' => array('type'=>'bool')),
214 'email_addresses_primary' =>
216 'name' => 'email_addresses_primary',
218 'relationship' => 'accounts_email_addresses_primary',
219 'source' => 'non-db',
220 'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
221 'duplicate_merge'=> 'disabled',
225 'name' => 'opportunities',
227 'relationship' => 'accounts_opportunities',
228 'module'=>'Opportunities',
229 'bean_name'=>'Opportunity',
231 'vname'=>'LBL_OPPORTUNITY',
239 'relationship' => 'projects_accounts',
241 'bean_name'=>'Project',
243 'vname'=>'LBL_PROJECTS',
249 'relationship' => 'account_leads',
253 'vname'=>'LBL_LEADS',
257 'name' => 'campaigns',
259 'relationship' => 'campaign_accounts',
260 'module'=>'Campaigns',
261 'bean_name'=>'Campaign',
263 'vname'=>'LBL_CAMPAIGNS',
267 'name' => 'created_by_link',
269 'relationship' => 'accounts_created_by',
270 'vname' => 'LBL_CREATED_BY_USER',
271 'link_type' => 'one',
276 'modified_user_link' =>
278 'name' => 'modified_user_link',
280 'relationship' => 'accounts_modified_user',
281 'vname' => 'LBL_MODIFIED_BY_USER',
282 'link_type' => 'one',
287 'assigned_user_link' =>
289 'name' => 'assigned_user_link',
291 'relationship' => 'accounts_assigned_user',
292 'vname' => 'LBL_ASSIGNED_TO_USER',
293 'link_type' => 'one',
297 'duplicate_merge'=>'enabled',
298 'rname' => 'user_name',
299 'id_name' => 'assigned_user_id',
304 'name' => 'products',
306 'relationship' => 'products_accounts',
307 'source' => 'non-db',
308 'vname' => 'LBL_PRODUCTS',
313 'name' => 'campaign_id',
314 'comment' => 'Campaign that generated Account',
315 'vname'=>'LBL_CAMPAIGN_ID',
317 'id_name' => 'campaign_id',
319 'table' => 'campaigns',
321 'module' => 'Campaigns',
323 'massupdate' => false,
324 'duplicate_merge'=> 'disabled',
329 'name'=>'campaign_name',
331 'vname' => 'LBL_CAMPAIGN',
335 'table' => 'campaigns',
336 'id_name' => 'campaign_id',
337 'link' => 'campaigns',
338 'module'=>'Campaigns',
339 'duplicate_merge'=>'disabled',
340 'comment' => 'The first campaign name for Account (Meta-data only)',
345 'name' => 'prospect_lists',
347 'relationship' => 'prospect_list_accounts',
348 'module'=>'ProspectLists',
350 'vname'=>'LBL_PROSPECT_LIST',
353 , 'indices' => array (
354 array('name' =>'idx_accnt_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')),
355 array('name' =>'idx_accnt_name_del', 'type' => 'index', 'fields'=>array('name', 'deleted')),//bug #5530
356 array('name' =>'idx_accnt_assigned_del', 'type' =>'index', 'fields'=>array( 'deleted', 'assigned_user_id')),
357 array('name' =>'idx_accnt_parent_id', 'type' =>'index', 'fields'=>array( 'parent_id')),
360 , 'relationships' => array (
361 'member_accounts' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
362 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'parent_id',
363 'relationship_type'=>'one-to-many')
365 ,'account_cases' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
366 'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'account_id',
367 'relationship_type'=>'one-to-many')
369 ,'account_tasks' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
370 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
371 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
372 'relationship_role_column_value'=>'Accounts')
374 ,'account_notes' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
375 'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
376 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
377 'relationship_role_column_value'=>'Accounts')
379 ,'account_meetings' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
380 'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'parent_id',
381 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
382 'relationship_role_column_value'=>'Accounts')
384 ,'account_calls' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
385 'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
386 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
387 'relationship_role_column_value'=>'Accounts')
389 /*,'accounts_emails' => array(
390 'rhs_module' => 'Emails',
391 'rhs_table' => 'emails',
393 'lhs_module' => 'Accounts',
394 'lhs_table' => 'accounts',
396 'relationship_type' => 'many-to-many',
397 'join_table' => 'emails_accounts',
398 'join_key_rhs' => 'email_id',
399 'join_key_lhs' => 'account_id'
402 ,'account_emails' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
403 'rhs_module'=> 'Emails', 'rhs_table'=> 'emails', 'rhs_key' => 'parent_id',
404 'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
405 'relationship_role_column_value'=>'Accounts')
407 ,'account_leads' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
408 'rhs_module'=> 'Leads', 'rhs_table'=> 'leads', 'rhs_key' => 'account_id',
409 'relationship_type'=>'one-to-many')
412 'accounts_assigned_user' =>
413 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
414 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'assigned_user_id',
415 'relationship_type'=>'one-to-many'),
417 'accounts_modified_user' =>
418 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
419 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'modified_user_id',
420 'relationship_type'=>'one-to-many'),
422 'accounts_created_by' =>
423 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
424 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'created_by',
425 'relationship_type'=>'one-to-many'),
427 //This enables optimistic locking for Saves From EditView
428 ,'optimistic_locking'=>true,
431 VardefManager::createVardef('Accounts','Account', array('default', 'assignable',
435 //jc - adding for refactor for import to not use the required_fields array
436 //defined in the field_arrays.php file
437 $dictionary['Account']['fields']['name']['importable'] = 'required';