2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 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),
157 'name' => 'phone_mobile',
158 'vname' => 'LBL_MOBILE_PHONE',
160 'dbType' => 'varchar',
162 'unified_search' => true,
163 'full_text_search' => array('boost' => 1),
164 'comment' => 'Mobile phone number of the contact',
165 'merge_filter' => 'enabled',
169 'name' => 'phone_work',
170 'vname' => 'LBL_OFFICE_PHONE',
172 'dbType' => 'varchar',
175 'unified_search' => true,
176 'full_text_search' => array('boost' => 1),
177 'comment' => 'Work phone number of the contact',
178 'merge_filter' => 'enabled',
182 'name' => 'phone_other',
183 'vname' => 'LBL_OTHER_PHONE',
185 'dbType' => 'varchar',
187 'unified_search' => true,
188 'full_text_search' => array('boost' => 1),
189 'comment' => 'Other phone number for the contact',
190 'merge_filter' => 'enabled',
194 'name' => 'phone_fax',
195 'vname' => 'LBL_FAX_PHONE',
197 'dbType' => 'varchar',
199 'unified_search' => true,
200 'full_text_search' => array('boost' => 1),
201 'comment' => 'Contact fax number',
202 'merge_filter' => 'enabled',
207 'vname' => 'LBL_EMAIL_ADDRESS',
210 'name' => 'getEmailAddressWidget',
211 'returns' => 'html'),
212 'source' => 'non-db',
214 'merge_filter' => 'enabled',
215 'studio' => array('editField' => true, 'searchview' => false, 'popupsearch' => false), // bug 46859
216 'full_text_search' => array('boost' => 3, 'index' => 'not_analyzed'), //bug 54567
221 'vname' => 'LBL_OTHER_EMAIL_ADDRESS',
224 'name' => 'getEmailAddressWidget',
225 'returns' => 'html'),
226 'source' => 'non-db',
228 'merge_filter' => 'enabled',
233 'name' => 'invalid_email',
234 'vname' => 'LBL_INVALID_EMAIL',
235 'source' => 'non-db',
237 'massupdate' => false,
242 'name' => 'email_opt_out',
243 'vname' => 'LBL_EMAIL_OPT_OUT',
244 'source' => 'non-db',
246 'massupdate' => false,
250 'primary_address_street' =>
252 'name' => 'primary_address_street',
253 'vname' => 'LBL_PRIMARY_ADDRESS_STREET',
256 'group'=>'primary_address',
257 'comment' => 'Street address for primary address',
258 'merge_filter' => 'enabled',
260 'primary_address_street_2' =>
262 'name' => 'primary_address_street_2',
263 'vname' => 'LBL_PRIMARY_ADDRESS_STREET_2',
266 'source' => 'non-db',
268 'primary_address_street_3' =>
270 'name' => 'primary_address_street_3',
271 'vname' => 'LBL_PRIMARY_ADDRESS_STREET_3',
274 'source' => 'non-db',
276 'primary_address_city' =>
278 'name' => 'primary_address_city',
279 'vname' => 'LBL_PRIMARY_ADDRESS_CITY',
282 'group'=>'primary_address',
283 'comment' => 'City for primary address',
284 'merge_filter' => 'enabled',
286 'primary_address_state' =>
288 'name' => 'primary_address_state',
289 'vname' => 'LBL_PRIMARY_ADDRESS_STATE',
292 'group'=>'primary_address',
293 'comment' => 'State for primary address',
294 'merge_filter' => 'enabled',
296 'primary_address_postalcode' =>
298 'name' => 'primary_address_postalcode',
299 'vname' => 'LBL_PRIMARY_ADDRESS_POSTALCODE',
302 'group'=>'primary_address',
303 'comment' => 'Postal code for primary address',
304 'merge_filter' => 'enabled',
307 'primary_address_country' =>
309 'name' => 'primary_address_country',
310 'vname' => 'LBL_PRIMARY_ADDRESS_COUNTRY',
312 'group'=>'primary_address',
313 'comment' => 'Country for primary address',
314 'merge_filter' => 'enabled',
316 'alt_address_street' =>
318 'name' => 'alt_address_street',
319 'vname' => 'LBL_ALT_ADDRESS_STREET',
322 'group'=>'alt_address',
323 'comment' => 'Street address for alternate address',
324 'merge_filter' => 'enabled',
326 'alt_address_street_2' =>
328 'name' => 'alt_address_street_2',
329 'vname' => 'LBL_ALT_ADDRESS_STREET_2',
332 'source' => 'non-db',
334 'alt_address_street_3' =>
336 'name' => 'alt_address_street_3',
337 'vname' => 'LBL_ALT_ADDRESS_STREET_3',
340 'source' => 'non-db',
342 'alt_address_city' =>
344 'name' => 'alt_address_city',
345 'vname' => 'LBL_ALT_ADDRESS_CITY',
348 'group'=>'alt_address',
349 'comment' => 'City for alternate address',
350 'merge_filter' => 'enabled',
352 'alt_address_state' =>
354 'name' => 'alt_address_state',
355 'vname' => 'LBL_ALT_ADDRESS_STATE',
358 'group'=>'alt_address',
359 'comment' => 'State for alternate address',
360 'merge_filter' => 'enabled',
362 'alt_address_postalcode' =>
364 'name' => 'alt_address_postalcode',
365 'vname' => 'LBL_ALT_ADDRESS_POSTALCODE',
368 'group'=>'alt_address',
369 'comment' => 'Postal code for alternate address',
370 'merge_filter' => 'enabled',
372 'alt_address_country' =>
374 'name' => 'alt_address_country',
375 'vname' => 'LBL_ALT_ADDRESS_COUNTRY',
377 'group'=>'alt_address',
378 'comment' => 'Country for alternate address',
379 'merge_filter' => 'enabled',
383 'name' => 'assistant',
384 'vname' => 'LBL_ASSISTANT',
387 'unified_search' => true,
388 'full_text_search' => array('boost' => 2),
389 'comment' => 'Name of the assistant of the contact',
390 'merge_filter' => 'enabled',
394 'name' => 'assistant_phone',
395 'vname' => 'LBL_ASSISTANT_PHONE',
397 'dbType' => 'varchar',
399 'group'=>'assistant',
400 'unified_search' => true,
401 'full_text_search' => array('boost' => 1),
402 'comment' => 'Phone number of the assistant of the contact',
403 'merge_filter' => 'enabled',
406 'email_addresses_primary' =>
408 'name' => 'email_addresses_primary',
410 'relationship' => strtolower($object_name).'_email_addresses_primary',
411 'source' => 'non-db',
412 'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
413 'duplicate_merge' => 'disabled',
417 'name' => 'email_addresses',
419 'relationship' => strtolower($object_name).'_email_addresses',
420 'source' => 'non-db',
421 'vname' => 'LBL_EMAIL_ADDRESSES',
423 'unified_search' => true,
424 'rel_fields' => array('primary_address' => array('type'=>'bool')),
427 'relationships'=>array(
428 strtolower($module).'_email_addresses' =>
430 'lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
431 'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
432 'relationship_type'=>'many-to-many',
433 'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
434 'relationship_role_column'=>'bean_module',
435 'relationship_role_column_value'=>$module
437 strtolower($module).'_email_addresses_primary' =>
438 array('lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
439 'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
440 'relationship_type'=>'many-to-many',
441 'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
442 'relationship_role_column'=>'primary_address',
443 'relationship_role_column_value'=>'1'