2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
41 'name' => 'salutation',
42 'vname' => 'LBL_SALUTATION',
44 'options' => 'salutation_dom',
45 'massupdate' => false,
47 'comment' => 'Contact salutation (e.g., Mr, Ms)'
51 'name' => 'first_name',
52 'vname' => 'LBL_FIRST_NAME',
55 'unified_search' => true,
56 'full_text_search' => array('boost' => 3),
57 'comment' => 'First name of the contact',
58 'merge_filter' => 'selected',
63 'name' => 'last_name',
64 'vname' => 'LBL_LAST_NAME',
67 'unified_search' => true,
68 'full_text_search' => array('boost' => 3),
69 'comment' => 'Last name of the contact',
70 'merge_filter' => 'selected',
72 'importable' => 'required',
78 'vname' => 'LBL_NAME',
80 'link' => true, // bug 39288
81 'fields' => array('first_name', 'last_name'),
82 'sort_on' => 'last_name',
86 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
87 'importable' => 'false',
91 'name' => 'full_name',
92 'rname' => 'full_name',
93 'vname' => 'LBL_NAME',
95 'fields' => array('first_name', 'last_name'),
96 'sort_on' => 'last_name',
100 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
101 'studio' => array('listview' => false),
106 'vname' => 'LBL_TITLE',
109 'comment' => 'The title of the contact'
113 'name' => 'department',
114 'vname' => 'LBL_DEPARTMENT',
117 'comment' => 'The department of the contact',
118 'merge_filter' => 'enabled',
122 'name' => 'do_not_call',
123 'vname' => 'LBL_DO_NOT_CALL',
127 'comment' => 'An indicator of whether contact can be called'
131 'name' => 'phone_home',
132 'vname' => 'LBL_HOME_PHONE',
134 'dbType' => 'varchar',
136 'unified_search' => true,
137 'full_text_search' => array('boost' => 1),
138 'comment' => 'Home phone number of the contact',
139 'merge_filter' => 'enabled',
145 'query_type' => 'default',
146 'source' => 'non-db',
147 'operator' => 'subquery',
148 'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 AND ea.email_address LIKE',
152 'vname' =>'LBL_ANY_EMAIL',
153 'studio' => array('visible'=>false, 'searchview'=>true),
154 'importable' => false,
158 'name' => 'phone_mobile',
159 'vname' => 'LBL_MOBILE_PHONE',
161 'dbType' => 'varchar',
163 'unified_search' => true,
164 'full_text_search' => array('boost' => 1),
165 'comment' => 'Mobile phone number of the contact',
166 'merge_filter' => 'enabled',
170 'name' => 'phone_work',
171 'vname' => 'LBL_OFFICE_PHONE',
173 'dbType' => 'varchar',
176 'unified_search' => true,
177 'full_text_search' => array('boost' => 1),
178 'comment' => 'Work phone number of the contact',
179 'merge_filter' => 'enabled',
183 'name' => 'phone_other',
184 'vname' => 'LBL_OTHER_PHONE',
186 'dbType' => 'varchar',
188 'unified_search' => true,
189 'full_text_search' => array('boost' => 1),
190 'comment' => 'Other phone number for the contact',
191 'merge_filter' => 'enabled',
195 'name' => 'phone_fax',
196 'vname' => 'LBL_FAX_PHONE',
198 'dbType' => 'varchar',
200 'unified_search' => true,
201 'full_text_search' => array('boost' => 1),
202 'comment' => 'Contact fax number',
203 'merge_filter' => 'enabled',
208 'vname' => 'LBL_EMAIL_ADDRESS',
211 'name' => 'getEmailAddressWidget',
212 'returns' => 'html'),
213 'source' => 'non-db',
215 'merge_filter' => 'enabled',
216 'studio' => array('editview' => true, 'editField' => true, 'searchview' => false, 'popupsearch' => false), // bug 46859
217 'full_text_search' => array('boost' => 3, 'analyzer' => 'whitespace'), //bug 54567
222 'vname' => 'LBL_OTHER_EMAIL_ADDRESS',
225 'name' => 'getEmailAddressWidget',
226 'returns' => 'html'),
227 'source' => 'non-db',
229 'merge_filter' => 'enabled',
234 'name' => 'invalid_email',
235 'vname' => 'LBL_INVALID_EMAIL',
236 'source' => 'non-db',
238 'massupdate' => false,
243 'name' => 'email_opt_out',
244 'vname' => 'LBL_EMAIL_OPT_OUT',
245 'source' => 'non-db',
247 'massupdate' => false,
251 'primary_address_street' =>
253 'name' => 'primary_address_street',
254 'vname' => 'LBL_PRIMARY_ADDRESS_STREET',
257 'group'=>'primary_address',
258 'comment' => 'Street address for primary address',
259 'merge_filter' => 'enabled',
261 'primary_address_street_2' =>
263 'name' => 'primary_address_street_2',
264 'vname' => 'LBL_PRIMARY_ADDRESS_STREET_2',
267 'source' => 'non-db',
269 'primary_address_street_3' =>
271 'name' => 'primary_address_street_3',
272 'vname' => 'LBL_PRIMARY_ADDRESS_STREET_3',
275 'source' => 'non-db',
277 'primary_address_city' =>
279 'name' => 'primary_address_city',
280 'vname' => 'LBL_PRIMARY_ADDRESS_CITY',
283 'group'=>'primary_address',
284 'comment' => 'City for primary address',
285 'merge_filter' => 'enabled',
287 'primary_address_state' =>
289 'name' => 'primary_address_state',
290 'vname' => 'LBL_PRIMARY_ADDRESS_STATE',
293 'group'=>'primary_address',
294 'comment' => 'State for primary address',
295 'merge_filter' => 'enabled',
297 'primary_address_postalcode' =>
299 'name' => 'primary_address_postalcode',
300 'vname' => 'LBL_PRIMARY_ADDRESS_POSTALCODE',
303 'group'=>'primary_address',
304 'comment' => 'Postal code for primary address',
305 'merge_filter' => 'enabled',
308 'primary_address_country' =>
310 'name' => 'primary_address_country',
311 'vname' => 'LBL_PRIMARY_ADDRESS_COUNTRY',
313 'group'=>'primary_address',
314 'comment' => 'Country for primary address',
315 'merge_filter' => 'enabled',
317 'alt_address_street' =>
319 'name' => 'alt_address_street',
320 'vname' => 'LBL_ALT_ADDRESS_STREET',
323 'group'=>'alt_address',
324 'comment' => 'Street address for alternate address',
325 'merge_filter' => 'enabled',
327 'alt_address_street_2' =>
329 'name' => 'alt_address_street_2',
330 'vname' => 'LBL_ALT_ADDRESS_STREET_2',
333 'source' => 'non-db',
335 'alt_address_street_3' =>
337 'name' => 'alt_address_street_3',
338 'vname' => 'LBL_ALT_ADDRESS_STREET_3',
341 'source' => 'non-db',
343 'alt_address_city' =>
345 'name' => 'alt_address_city',
346 'vname' => 'LBL_ALT_ADDRESS_CITY',
349 'group'=>'alt_address',
350 'comment' => 'City for alternate address',
351 'merge_filter' => 'enabled',
353 'alt_address_state' =>
355 'name' => 'alt_address_state',
356 'vname' => 'LBL_ALT_ADDRESS_STATE',
359 'group'=>'alt_address',
360 'comment' => 'State for alternate address',
361 'merge_filter' => 'enabled',
363 'alt_address_postalcode' =>
365 'name' => 'alt_address_postalcode',
366 'vname' => 'LBL_ALT_ADDRESS_POSTALCODE',
369 'group'=>'alt_address',
370 'comment' => 'Postal code for alternate address',
371 'merge_filter' => 'enabled',
373 'alt_address_country' =>
375 'name' => 'alt_address_country',
376 'vname' => 'LBL_ALT_ADDRESS_COUNTRY',
378 'group'=>'alt_address',
379 'comment' => 'Country for alternate address',
380 'merge_filter' => 'enabled',
384 'name' => 'assistant',
385 'vname' => 'LBL_ASSISTANT',
388 'unified_search' => true,
389 'full_text_search' => array('boost' => 2),
390 'comment' => 'Name of the assistant of the contact',
391 'merge_filter' => 'enabled',
395 'name' => 'assistant_phone',
396 'vname' => 'LBL_ASSISTANT_PHONE',
398 'dbType' => 'varchar',
400 'group'=>'assistant',
401 'unified_search' => true,
402 'full_text_search' => array('boost' => 1),
403 'comment' => 'Phone number of the assistant of the contact',
404 'merge_filter' => 'enabled',
407 'email_addresses_primary' =>
409 'name' => 'email_addresses_primary',
411 'relationship' => strtolower($object_name).'_email_addresses_primary',
412 'source' => 'non-db',
413 'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
414 'duplicate_merge' => 'disabled',
418 'name' => 'email_addresses',
420 'relationship' => strtolower($object_name).'_email_addresses',
421 'source' => 'non-db',
422 'vname' => 'LBL_EMAIL_ADDRESSES',
424 'unified_search' => true,
425 'rel_fields' => array('primary_address' => array('type'=>'bool')),
427 // Used for non-primary mail import
428 'email_addresses_non_primary'=>
430 'name' => 'email_addresses_non_primary',
432 'source' => 'non-db',
433 'vname' =>'LBL_EMAIL_NON_PRIMARY',
436 'massupdate' => false,
439 'relationships'=>array(
440 strtolower($module).'_email_addresses' =>
442 'lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
443 'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
444 'relationship_type'=>'many-to-many',
445 'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
446 'relationship_role_column'=>'bean_module',
447 'relationship_role_column_value'=>$module
449 strtolower($module).'_email_addresses_primary' =>
450 array('lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
451 'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
452 'relationship_type'=>'many-to-many',
453 'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
454 'relationship_role_column'=>'primary_address',
455 'relationship_role_column_value'=>'1'