]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/SugarObjects/templates/person/vardefs.php
Release 6.5.16
[Github/sugarcrm.git] / include / SugarObjects / templates / person / vardefs.php
1 <?php
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
5  * 
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.
12  * 
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
16  * details.
17  * 
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
21  * 02110-1301 USA.
22  * 
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.
25  * 
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.
29  * 
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  ********************************************************************************/
36
37 $vardefs =array(
38 'fields'=> array(
39 'salutation' =>
40                 array (
41                         'name' => 'salutation',
42                         'vname' => 'LBL_SALUTATION',
43                         'type' => 'enum',
44                         'options' => 'salutation_dom',
45                         'massupdate' => false,
46                         'len' => '255',
47                         'comment' => 'Contact salutation (e.g., Mr, Ms)'            
48                 ),
49 'first_name' =>
50                 array (
51                         'name' => 'first_name',
52                         'vname' => 'LBL_FIRST_NAME',
53                         'type' => 'varchar',
54                         'len' => '100',
55                         'unified_search' => true,
56                         'full_text_search' => array('boost' => 3),
57                         'comment' => 'First name of the contact',
58             'merge_filter' => 'selected',     
59             
60                 ),
61         'last_name' =>
62                 array (
63                         'name' => 'last_name',
64                         'vname' => 'LBL_LAST_NAME',
65                         'type' => 'varchar',
66                         'len' => '100',
67                         'unified_search' => true, 
68                         'full_text_search' => array('boost' => 3),
69                         'comment' => 'Last name of the contact',
70             'merge_filter' => 'selected',
71             'required'=>true,
72             'importable' => 'required',
73                 ),
74         'name' =>
75                 array (
76                         'name' => 'name',
77                         'rname' => 'name',
78                         'vname' => 'LBL_NAME',
79                         'type' => 'name',
80                         'link' => true, // bug 39288 
81                         'fields' => array('first_name', 'last_name'),
82                         'sort_on' => 'last_name',
83                         'source' => 'non-db',
84                         'group'=>'last_name',
85                         'len' => '255',
86                         'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
87             'importable' => 'false',
88                 ),
89         'full_name' =>
90                 array (
91                         'name' => 'full_name',
92                         'rname' => 'full_name',
93                         'vname' => 'LBL_NAME',
94                         'type' => 'fullname',
95                         'fields' => array('first_name', 'last_name'),
96                         'sort_on' => 'last_name',
97                         'source' => 'non-db',
98                         'group'=>'last_name',
99                         'len' => '510',
100                         'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
101                         'studio' => array('listview' => false),
102                 ),
103         'title' =>
104                 array (
105                         'name' => 'title',
106                         'vname' => 'LBL_TITLE',
107                         'type' => 'varchar',
108                         'len' => '100',
109                         'comment' => 'The title of the contact'
110                 ),
111         'department' =>
112                 array (
113                         'name' => 'department',
114                         'vname' => 'LBL_DEPARTMENT',
115                         'type' => 'varchar',
116                         'len' => '255',
117                         'comment' => 'The department of the contact',
118             'merge_filter' => 'enabled',
119                 ),
120                 'do_not_call' =>
121                 array (
122                         'name' => 'do_not_call',
123                         'vname' => 'LBL_DO_NOT_CALL',
124                         'type' => 'bool',
125                         'default' => '0',
126                         'audited'=>true,
127                         'comment' => 'An indicator of whether contact can be called'
128                 ),
129         'phone_home' =>
130                 array (
131                         'name' => 'phone_home',
132                         'vname' => 'LBL_HOME_PHONE',
133                         'type' => 'phone',
134                         'dbType' => 'varchar',
135                         'len' => 100,
136                         'unified_search' => true, 
137                         'full_text_search' => array('boost' => 1),
138                         'comment' => 'Home phone number of the contact',
139             'merge_filter' => 'enabled',
140                 ),
141                 //bug 42902
142                 'email'=> array(
143                         'name' => 'email',
144                         'type' => 'email',
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',
149                         'db_field' => array(
150                                 'id',
151                         ),
152                         'vname' =>'LBL_ANY_EMAIL',
153                         'studio' => array('visible'=>false, 'searchview'=>true),
154             'importable' => false,
155                 ),
156         'phone_mobile' =>
157                 array (
158                         'name' => 'phone_mobile',
159                         'vname' => 'LBL_MOBILE_PHONE',
160                         'type' => 'phone',
161                         'dbType' => 'varchar',
162                         'len' => 100,
163                         'unified_search' => true,
164                         'full_text_search' => array('boost' => 1),
165                         'comment' => 'Mobile phone number of the contact',
166             'merge_filter' => 'enabled',
167                 ),
168         'phone_work' =>
169                 array (
170                         'name' => 'phone_work',
171                         'vname' => 'LBL_OFFICE_PHONE',
172                         'type' => 'phone',
173                         'dbType' => 'varchar',
174                         'len' => 100,
175                         'audited'=>true,
176                         'unified_search' => true,
177                         'full_text_search' => array('boost' => 1),
178                         'comment' => 'Work phone number of the contact',
179             'merge_filter' => 'enabled',
180                 ),
181         'phone_other' =>
182                 array (
183                         'name' => 'phone_other',
184                         'vname' => 'LBL_OTHER_PHONE',
185                         'type' => 'phone',
186                         'dbType' => 'varchar',
187                         'len' => 100,
188                         'unified_search' => true,
189                         'full_text_search' => array('boost' => 1),
190                         'comment' => 'Other phone number for the contact',
191             'merge_filter' => 'enabled',
192                 ),
193         'phone_fax' =>
194                 array (
195                         'name' => 'phone_fax',
196                         'vname' => 'LBL_FAX_PHONE',
197                         'type' => 'phone',
198                         'dbType' => 'varchar',
199                         'len' => 100,
200                         'unified_search' => true,
201                         'full_text_search' => array('boost' => 1),
202                         'comment' => 'Contact fax number',
203             'merge_filter' => 'enabled',
204                 ),
205         'email1' => 
206                 array(
207                         'name'          => 'email1',
208                         'vname'         => 'LBL_EMAIL_ADDRESS',
209                         'type'          => 'varchar',
210                         'function'      => array(
211                                 'name'          => 'getEmailAddressWidget',
212                                 'returns'       => 'html'),
213                         'source'        => 'non-db',
214                         'group'=>'email1',
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
218                 ),
219         'email2' => 
220                 array(
221                         'name'          => 'email2',
222                         'vname'         => 'LBL_OTHER_EMAIL_ADDRESS',
223                         'type'          => 'varchar',
224                         'function'      => array(
225                                 'name'          => 'getEmailAddressWidget',
226                                 'returns'       => 'html'),
227                         'source'        => 'non-db',
228                         'group'=>'email2',
229             'merge_filter' => 'enabled',
230                     'studio' => 'false',
231                 ),
232     'invalid_email' => 
233                 array(
234                         'name'          => 'invalid_email',
235                         'vname'     => 'LBL_INVALID_EMAIL',
236                         'source'        => 'non-db',
237                         'type'          => 'bool',
238                     'massupdate' => false,
239                     'studio' => 'false',
240                 ),    
241     'email_opt_out' => 
242                 array(
243                         'name'          => 'email_opt_out',
244                         'vname'     => 'LBL_EMAIL_OPT_OUT',
245                         'source'        => 'non-db',
246                         'type'          => 'bool',
247                     'massupdate' => false,
248                         'studio'=>'false',
249                 ),
250                 
251         'primary_address_street' =>
252                 array (
253                         'name' => 'primary_address_street',
254                         'vname' => 'LBL_PRIMARY_ADDRESS_STREET',
255                         'type' => 'varchar',
256                         'len' => '150',
257                         'group'=>'primary_address',
258                         'comment' => 'Street address for primary address',
259             'merge_filter' => 'enabled',
260                 ),
261         'primary_address_street_2' =>
262                 array (
263                         'name' => 'primary_address_street_2',
264                         'vname' => 'LBL_PRIMARY_ADDRESS_STREET_2',
265                         'type' => 'varchar',
266                         'len' => '150',
267                         'source' => 'non-db',
268                 ),
269         'primary_address_street_3' =>
270                 array (
271                         'name' => 'primary_address_street_3',
272                         'vname' => 'LBL_PRIMARY_ADDRESS_STREET_3',
273                         'type' => 'varchar',
274                         'len' => '150',
275                         'source' => 'non-db',
276                 ),              
277         'primary_address_city' =>
278                 array (
279                         'name' => 'primary_address_city',
280                         'vname' => 'LBL_PRIMARY_ADDRESS_CITY',
281                         'type' => 'varchar',
282                         'len' => '100',
283                         'group'=>'primary_address',
284                         'comment' => 'City for primary address',
285             'merge_filter' => 'enabled',
286                 ),
287         'primary_address_state' =>
288                 array (
289                         'name' => 'primary_address_state',
290                         'vname' => 'LBL_PRIMARY_ADDRESS_STATE',
291                         'type' => 'varchar',
292                         'len' => '100',
293                         'group'=>'primary_address',
294                         'comment' => 'State for primary address',
295             'merge_filter' => 'enabled',
296                 ),
297         'primary_address_postalcode' =>
298                 array (
299                         'name' => 'primary_address_postalcode',
300                         'vname' => 'LBL_PRIMARY_ADDRESS_POSTALCODE',
301                         'type' => 'varchar',
302                         'len' => '20',
303                         'group'=>'primary_address',
304                         'comment' => 'Postal code for primary address',
305             'merge_filter' => 'enabled',
306             
307                 ),
308         'primary_address_country' =>
309                 array (
310                         'name' => 'primary_address_country',
311                         'vname' => 'LBL_PRIMARY_ADDRESS_COUNTRY',
312                         'type' => 'varchar',
313                         'group'=>'primary_address',
314                         'comment' => 'Country for primary address',
315             'merge_filter' => 'enabled',
316                 ),
317         'alt_address_street' =>
318                 array (
319                         'name' => 'alt_address_street',
320                         'vname' => 'LBL_ALT_ADDRESS_STREET',
321                         'type' => 'varchar',
322                         'len' => '150',
323                         'group'=>'alt_address',
324                         'comment' => 'Street address for alternate address',
325             'merge_filter' => 'enabled',
326                 ),
327         'alt_address_street_2' =>
328                 array (
329                         'name' => 'alt_address_street_2',
330                         'vname' => 'LBL_ALT_ADDRESS_STREET_2',
331                         'type' => 'varchar',
332                         'len' => '150',
333                         'source' => 'non-db',
334                 ),
335         'alt_address_street_3' =>
336                 array (
337                         'name' => 'alt_address_street_3',
338                         'vname' => 'LBL_ALT_ADDRESS_STREET_3',
339                         'type' => 'varchar',
340                         'len' => '150',
341                         'source' => 'non-db',
342                 ),                      
343         'alt_address_city' =>
344                 array (
345                         'name' => 'alt_address_city',
346                         'vname' => 'LBL_ALT_ADDRESS_CITY',
347                         'type' => 'varchar',
348                         'len' => '100',
349                         'group'=>'alt_address',
350                         'comment' => 'City for alternate address',
351             'merge_filter' => 'enabled',
352                 ),
353         'alt_address_state' =>
354                 array (
355                         'name' => 'alt_address_state',
356                         'vname' => 'LBL_ALT_ADDRESS_STATE',
357                         'type' => 'varchar',
358                         'len' => '100',
359                         'group'=>'alt_address',
360                         'comment' => 'State for alternate address',
361             'merge_filter' => 'enabled',
362                 ),
363         'alt_address_postalcode' =>
364                 array (
365                         'name' => 'alt_address_postalcode',
366                         'vname' => 'LBL_ALT_ADDRESS_POSTALCODE',
367                         'type' => 'varchar',
368                         'len' => '20',
369                         'group'=>'alt_address',
370                         'comment' => 'Postal code for alternate address',
371             'merge_filter' => 'enabled',
372                 ),
373         'alt_address_country' =>
374                 array (
375                         'name' => 'alt_address_country',
376                         'vname' => 'LBL_ALT_ADDRESS_COUNTRY',
377                         'type' => 'varchar',
378                         'group'=>'alt_address',
379                         'comment' => 'Country for alternate address',
380             'merge_filter' => 'enabled',
381                 ),
382                 'assistant' =>
383                 array (
384                         'name' => 'assistant',
385                         'vname' => 'LBL_ASSISTANT',
386                         'type' => 'varchar',
387                         'len' => '75',
388                         'unified_search' => true,
389                         'full_text_search' => array('boost' => 2),
390                         'comment' => 'Name of the assistant of the contact',
391             'merge_filter' => 'enabled',
392                 ),
393         'assistant_phone' =>
394                 array (
395                         'name' => 'assistant_phone',
396                         'vname' => 'LBL_ASSISTANT_PHONE',
397                         'type' => 'phone',
398                         'dbType' => 'varchar',
399                         'len' => 100,
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',
405                 ),
406                 
407         'email_addresses_primary' => 
408                 array (
409             'name' => 'email_addresses_primary',
410             'type' => 'link',
411             'relationship' => strtolower($object_name).'_email_addresses_primary',
412             'source' => 'non-db',
413             'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
414             'duplicate_merge' => 'disabled',
415                 ),
416     'email_addresses' =>
417                 array (
418             'name' => 'email_addresses',
419             'type' => 'link',
420             'relationship' => strtolower($object_name).'_email_addresses',
421             'source' => 'non-db',
422             'vname' => 'LBL_EMAIL_ADDRESSES',
423             'reportable'=>false,
424             'unified_search' => true,
425             'rel_fields' => array('primary_address' => array('type'=>'bool')),
426         ),
427     // Used for non-primary mail import
428     'email_addresses_non_primary'=>
429         array(
430             'name' => 'email_addresses_non_primary',
431             'type' => 'email',
432             'source' => 'non-db',
433             'vname' =>'LBL_EMAIL_NON_PRIMARY',
434             'studio' => false,
435             'reportable'=>false,
436             'massupdate' => false,
437         ),
438 ), 
439 'relationships'=>array(
440     strtolower($module).'_email_addresses' => 
441     array(
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
448     ),
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'
456     ),
457 )
458 );
459 ?>