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 'comment' => 'First name of the contact',
57 'merge_filter' => 'selected',
62 'name' => 'last_name',
63 'vname' => 'LBL_LAST_NAME',
66 'unified_search' => true,
67 'comment' => 'Last name of the contact',
68 'merge_filter' => 'selected',
70 'importable' => 'required',
76 'vname' => 'LBL_NAME',
78 'link' => true, // bug 39288
79 'fields' => array('first_name', 'last_name'),
80 'sort_on' => 'last_name',
84 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
85 'importable' => 'false',
89 'name' => 'full_name',
90 'rname' => 'full_name',
91 'vname' => 'LBL_NAME',
93 'fields' => array('first_name', 'last_name'),
94 'sort_on' => 'last_name',
98 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
99 'studio' => array('listview' => false),
104 'vname' => 'LBL_TITLE',
107 'comment' => 'The title of the contact'
111 'name' => 'department',
112 'vname' => 'LBL_DEPARTMENT',
115 'comment' => 'The department of the contact',
116 'merge_filter' => 'enabled',
120 'name' => 'do_not_call',
121 'vname' => 'LBL_DO_NOT_CALL',
125 'comment' => 'An indicator of whether contact can be called'
129 'name' => 'phone_home',
130 'vname' => 'LBL_HOME_PHONE',
132 'dbType' => 'varchar',
134 'unified_search' => true,
135 'comment' => 'Home phone number of the contact',
136 'merge_filter' => 'enabled',
142 'query_type' => 'default',
143 'source' => 'non-db',
144 'operator' => 'subquery',
145 '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',
149 'vname' =>'LBL_ANY_EMAIL',
150 'studio' => array('visible'=>false, 'searchview'=>true),
154 'name' => 'phone_mobile',
155 'vname' => 'LBL_MOBILE_PHONE',
157 'dbType' => 'varchar',
159 'unified_search' => true,
160 'comment' => 'Mobile phone number of the contact',
161 'merge_filter' => 'enabled',
165 'name' => 'phone_work',
166 'vname' => 'LBL_OFFICE_PHONE',
168 'dbType' => 'varchar',
171 'unified_search' => true,
172 'comment' => 'Work phone number of the contact',
173 'merge_filter' => 'enabled',
177 'name' => 'phone_other',
178 'vname' => 'LBL_OTHER_PHONE',
180 'dbType' => 'varchar',
182 'unified_search' => true,
183 'comment' => 'Other phone number for the contact',
184 'merge_filter' => 'enabled',
188 'name' => 'phone_fax',
189 'vname' => 'LBL_FAX_PHONE',
191 'dbType' => 'varchar',
193 'unified_search' => true,
194 'comment' => 'Contact fax number',
195 'merge_filter' => 'enabled',
200 'vname' => 'LBL_EMAIL_ADDRESS',
203 'name' => 'getEmailAddressWidget',
204 'returns' => 'html'),
205 'source' => 'non-db',
207 'merge_filter' => 'enabled',
208 'studio' => array('editField' => true, 'searchview' => false, 'popupsearch' => false), // bug 46859
214 'vname' => 'LBL_OTHER_EMAIL_ADDRESS',
217 'name' => 'getEmailAddressWidget',
218 'returns' => 'html'),
219 'source' => 'non-db',
221 'merge_filter' => 'enabled',
226 'name' => 'invalid_email',
227 'vname' => 'LBL_INVALID_EMAIL',
228 'source' => 'non-db',
230 'massupdate' => false,
235 'name' => 'email_opt_out',
236 'vname' => 'LBL_EMAIL_OPT_OUT',
237 'source' => 'non-db',
239 'massupdate' => false,
243 'primary_address_street' =>
245 'name' => 'primary_address_street',
246 'vname' => 'LBL_PRIMARY_ADDRESS_STREET',
249 'group'=>'primary_address',
250 'comment' => 'Street address for primary address',
251 'merge_filter' => 'enabled',
253 'primary_address_street_2' =>
255 'name' => 'primary_address_street_2',
256 'vname' => 'LBL_PRIMARY_ADDRESS_STREET_2',
259 'source' => 'non-db',
261 'primary_address_street_3' =>
263 'name' => 'primary_address_street_3',
264 'vname' => 'LBL_PRIMARY_ADDRESS_STREET_3',
267 'source' => 'non-db',
269 'primary_address_city' =>
271 'name' => 'primary_address_city',
272 'vname' => 'LBL_PRIMARY_ADDRESS_CITY',
275 'group'=>'primary_address',
276 'comment' => 'City for primary address',
277 'merge_filter' => 'enabled',
279 'primary_address_state' =>
281 'name' => 'primary_address_state',
282 'vname' => 'LBL_PRIMARY_ADDRESS_STATE',
285 'group'=>'primary_address',
286 'comment' => 'State for primary address',
287 'merge_filter' => 'enabled',
289 'primary_address_postalcode' =>
291 'name' => 'primary_address_postalcode',
292 'vname' => 'LBL_PRIMARY_ADDRESS_POSTALCODE',
295 'group'=>'primary_address',
296 'comment' => 'Postal code for primary address',
297 'merge_filter' => 'enabled',
300 'primary_address_country' =>
302 'name' => 'primary_address_country',
303 'vname' => 'LBL_PRIMARY_ADDRESS_COUNTRY',
305 'group'=>'primary_address',
306 'comment' => 'Country for primary address',
307 'merge_filter' => 'enabled',
309 'alt_address_street' =>
311 'name' => 'alt_address_street',
312 'vname' => 'LBL_ALT_ADDRESS_STREET',
315 'group'=>'alt_address',
316 'comment' => 'Street address for alternate address',
317 'merge_filter' => 'enabled',
319 'alt_address_street_2' =>
321 'name' => 'alt_address_street_2',
322 'vname' => 'LBL_ALT_ADDRESS_STREET_2',
325 'source' => 'non-db',
327 'alt_address_street_3' =>
329 'name' => 'alt_address_street_3',
330 'vname' => 'LBL_ALT_ADDRESS_STREET_3',
333 'source' => 'non-db',
335 'alt_address_city' =>
337 'name' => 'alt_address_city',
338 'vname' => 'LBL_ALT_ADDRESS_CITY',
341 'group'=>'alt_address',
342 'comment' => 'City for alternate address',
343 'merge_filter' => 'enabled',
345 'alt_address_state' =>
347 'name' => 'alt_address_state',
348 'vname' => 'LBL_ALT_ADDRESS_STATE',
351 'group'=>'alt_address',
352 'comment' => 'State for alternate address',
353 'merge_filter' => 'enabled',
355 'alt_address_postalcode' =>
357 'name' => 'alt_address_postalcode',
358 'vname' => 'LBL_ALT_ADDRESS_POSTALCODE',
361 'group'=>'alt_address',
362 'comment' => 'Postal code for alternate address',
363 'merge_filter' => 'enabled',
365 'alt_address_country' =>
367 'name' => 'alt_address_country',
368 'vname' => 'LBL_ALT_ADDRESS_COUNTRY',
370 'group'=>'alt_address',
371 'comment' => 'Country for alternate address',
372 'merge_filter' => 'enabled',
376 'name' => 'assistant',
377 'vname' => 'LBL_ASSISTANT',
380 'unified_search' => true,
381 'comment' => 'Name of the assistant of the contact',
382 'merge_filter' => 'enabled',
386 'name' => 'assistant_phone',
387 'vname' => 'LBL_ASSISTANT_PHONE',
389 'dbType' => 'varchar',
391 'group'=>'assistant',
392 'unified_search' => true,
393 'comment' => 'Phone number of the assistant of the contact',
394 'merge_filter' => 'enabled',
397 'email_addresses_primary' =>
399 'name' => 'email_addresses_primary',
401 'relationship' => strtolower($object_name).'_email_addresses_primary',
402 'source' => 'non-db',
403 'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
404 'duplicate_merge' => 'disabled',
408 'name' => 'email_addresses',
410 'relationship' => strtolower($object_name).'_email_addresses',
411 'source' => 'non-db',
412 'vname' => 'LBL_EMAIL_ADDRESSES',
414 'unified_search' => true,
415 'rel_fields' => array('primary_address' => array('type'=>'bool')),
418 'relationships'=>array(
419 strtolower($module).'_email_addresses' =>
421 'lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
422 'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
423 'relationship_type'=>'many-to-many',
424 'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
425 'relationship_role_column'=>'bean_module',
426 'relationship_role_column_value'=>$module
428 strtolower($module).'_email_addresses_primary' =>
429 array('lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
430 'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
431 'relationship_type'=>'many-to-many',
432 'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
433 'relationship_role_column'=>'primary_address',
434 'relationship_role_column_value'=>'1'