]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/SugarObjects/templates/person/vardefs.php
Release 6.5.0
[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-2012 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                 ),
155         'phone_mobile' =>
156                 array (
157                         'name' => 'phone_mobile',
158                         'vname' => 'LBL_MOBILE_PHONE',
159                         'type' => 'phone',
160                         'dbType' => 'varchar',
161                         'len' => 100,
162                         'unified_search' => true,
163                         'full_text_search' => array('boost' => 1),
164                         'comment' => 'Mobile phone number of the contact',
165             'merge_filter' => 'enabled',
166                 ),
167         'phone_work' =>
168                 array (
169                         'name' => 'phone_work',
170                         'vname' => 'LBL_OFFICE_PHONE',
171                         'type' => 'phone',
172                         'dbType' => 'varchar',
173                         'len' => 100,
174                         'audited'=>true,
175                         'unified_search' => true,
176                         'full_text_search' => array('boost' => 1),
177                         'comment' => 'Work phone number of the contact',
178             'merge_filter' => 'enabled',
179                 ),
180         'phone_other' =>
181                 array (
182                         'name' => 'phone_other',
183                         'vname' => 'LBL_OTHER_PHONE',
184                         'type' => 'phone',
185                         'dbType' => 'varchar',
186                         'len' => 100,
187                         'unified_search' => true,
188                         'full_text_search' => array('boost' => 1),
189                         'comment' => 'Other phone number for the contact',
190             'merge_filter' => 'enabled',
191                 ),
192         'phone_fax' =>
193                 array (
194                         'name' => 'phone_fax',
195                         'vname' => 'LBL_FAX_PHONE',
196                         'type' => 'phone',
197                         'dbType' => 'varchar',
198                         'len' => 100,
199                         'unified_search' => true,
200                         'full_text_search' => array('boost' => 1),
201                         'comment' => 'Contact fax number',
202             'merge_filter' => 'enabled',
203                 ),
204         'email1' => 
205                 array(
206                         'name'          => 'email1',
207                         'vname'         => 'LBL_EMAIL_ADDRESS',
208                         'type'          => 'varchar',
209                         'function'      => array(
210                                 'name'          => 'getEmailAddressWidget',
211                                 'returns'       => 'html'),
212                         'source'        => 'non-db',
213                         'group'=>'email1',
214             'merge_filter' => 'enabled',
215                     'studio' => array('editField' => true, 'searchview' => false, 'popupsearch' => false), // bug 46859 
216
217                 ),
218         'email2' => 
219                 array(
220                         'name'          => 'email2',
221                         'vname'         => 'LBL_OTHER_EMAIL_ADDRESS',
222                         'type'          => 'varchar',
223                         'function'      => array(
224                                 'name'          => 'getEmailAddressWidget',
225                                 'returns'       => 'html'),
226                         'source'        => 'non-db',
227                         'group'=>'email2',
228             'merge_filter' => 'enabled',
229                     'studio' => 'false',
230                 ),
231     'invalid_email' => 
232                 array(
233                         'name'          => 'invalid_email',
234                         'vname'     => 'LBL_INVALID_EMAIL',
235                         'source'        => 'non-db',
236                         'type'          => 'bool',
237                     'massupdate' => false,
238                     'studio' => 'false',
239                 ),    
240     'email_opt_out' => 
241                 array(
242                         'name'          => 'email_opt_out',
243                         'vname'     => 'LBL_EMAIL_OPT_OUT',
244                         'source'        => 'non-db',
245                         'type'          => 'bool',
246                     'massupdate' => false,
247                         'studio'=>'false',
248                 ),
249                 
250         'primary_address_street' =>
251                 array (
252                         'name' => 'primary_address_street',
253                         'vname' => 'LBL_PRIMARY_ADDRESS_STREET',
254                         'type' => 'varchar',
255                         'len' => '150',
256                         'group'=>'primary_address',
257                         'comment' => 'Street address for primary address',
258             'merge_filter' => 'enabled',
259                 ),
260         'primary_address_street_2' =>
261                 array (
262                         'name' => 'primary_address_street_2',
263                         'vname' => 'LBL_PRIMARY_ADDRESS_STREET_2',
264                         'type' => 'varchar',
265                         'len' => '150',
266                         'source' => 'non-db',
267                 ),
268         'primary_address_street_3' =>
269                 array (
270                         'name' => 'primary_address_street_3',
271                         'vname' => 'LBL_PRIMARY_ADDRESS_STREET_3',
272                         'type' => 'varchar',
273                         'len' => '150',
274                         'source' => 'non-db',
275                 ),              
276         'primary_address_city' =>
277                 array (
278                         'name' => 'primary_address_city',
279                         'vname' => 'LBL_PRIMARY_ADDRESS_CITY',
280                         'type' => 'varchar',
281                         'len' => '100',
282                         'group'=>'primary_address',
283                         'comment' => 'City for primary address',
284             'merge_filter' => 'enabled',
285                 ),
286         'primary_address_state' =>
287                 array (
288                         'name' => 'primary_address_state',
289                         'vname' => 'LBL_PRIMARY_ADDRESS_STATE',
290                         'type' => 'varchar',
291                         'len' => '100',
292                         'group'=>'primary_address',
293                         'comment' => 'State for primary address',
294             'merge_filter' => 'enabled',
295                 ),
296         'primary_address_postalcode' =>
297                 array (
298                         'name' => 'primary_address_postalcode',
299                         'vname' => 'LBL_PRIMARY_ADDRESS_POSTALCODE',
300                         'type' => 'varchar',
301                         'len' => '20',
302                         'group'=>'primary_address',
303                         'comment' => 'Postal code for primary address',
304             'merge_filter' => 'enabled',
305             
306                 ),
307         'primary_address_country' =>
308                 array (
309                         'name' => 'primary_address_country',
310                         'vname' => 'LBL_PRIMARY_ADDRESS_COUNTRY',
311                         'type' => 'varchar',
312                         'group'=>'primary_address',
313                         'comment' => 'Country for primary address',
314             'merge_filter' => 'enabled',
315                 ),
316         'alt_address_street' =>
317                 array (
318                         'name' => 'alt_address_street',
319                         'vname' => 'LBL_ALT_ADDRESS_STREET',
320                         'type' => 'varchar',
321                         'len' => '150',
322                         'group'=>'alt_address',
323                         'comment' => 'Street address for alternate address',
324             'merge_filter' => 'enabled',
325                 ),
326         'alt_address_street_2' =>
327                 array (
328                         'name' => 'alt_address_street_2',
329                         'vname' => 'LBL_ALT_ADDRESS_STREET_2',
330                         'type' => 'varchar',
331                         'len' => '150',
332                         'source' => 'non-db',
333                 ),
334         'alt_address_street_3' =>
335                 array (
336                         'name' => 'alt_address_street_3',
337                         'vname' => 'LBL_ALT_ADDRESS_STREET_3',
338                         'type' => 'varchar',
339                         'len' => '150',
340                         'source' => 'non-db',
341                 ),                      
342         'alt_address_city' =>
343                 array (
344                         'name' => 'alt_address_city',
345                         'vname' => 'LBL_ALT_ADDRESS_CITY',
346                         'type' => 'varchar',
347                         'len' => '100',
348                         'group'=>'alt_address',
349                         'comment' => 'City for alternate address',
350             'merge_filter' => 'enabled',
351                 ),
352         'alt_address_state' =>
353                 array (
354                         'name' => 'alt_address_state',
355                         'vname' => 'LBL_ALT_ADDRESS_STATE',
356                         'type' => 'varchar',
357                         'len' => '100',
358                         'group'=>'alt_address',
359                         'comment' => 'State for alternate address',
360             'merge_filter' => 'enabled',
361                 ),
362         'alt_address_postalcode' =>
363                 array (
364                         'name' => 'alt_address_postalcode',
365                         'vname' => 'LBL_ALT_ADDRESS_POSTALCODE',
366                         'type' => 'varchar',
367                         'len' => '20',
368                         'group'=>'alt_address',
369                         'comment' => 'Postal code for alternate address',
370             'merge_filter' => 'enabled',
371                 ),
372         'alt_address_country' =>
373                 array (
374                         'name' => 'alt_address_country',
375                         'vname' => 'LBL_ALT_ADDRESS_COUNTRY',
376                         'type' => 'varchar',
377                         'group'=>'alt_address',
378                         'comment' => 'Country for alternate address',
379             'merge_filter' => 'enabled',
380                 ),
381                 'assistant' =>
382                 array (
383                         'name' => 'assistant',
384                         'vname' => 'LBL_ASSISTANT',
385                         'type' => 'varchar',
386                         'len' => '75',
387                         'unified_search' => true,
388                         'full_text_search' => array('boost' => 2),
389                         'comment' => 'Name of the assistant of the contact',
390             'merge_filter' => 'enabled',
391                 ),
392         'assistant_phone' =>
393                 array (
394                         'name' => 'assistant_phone',
395                         'vname' => 'LBL_ASSISTANT_PHONE',
396                         'type' => 'phone',
397                         'dbType' => 'varchar',
398                         'len' => 100,
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',
404                 ),
405                 
406         'email_addresses_primary' => 
407                 array (
408             'name' => 'email_addresses_primary',
409             'type' => 'link',
410             'relationship' => strtolower($object_name).'_email_addresses_primary',
411             'source' => 'non-db',
412             'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
413             'duplicate_merge' => 'disabled',
414                 ),
415     'email_addresses' =>
416                 array (
417             'name' => 'email_addresses',
418             'type' => 'link',
419             'relationship' => strtolower($object_name).'_email_addresses',
420             'source' => 'non-db',
421             'vname' => 'LBL_EMAIL_ADDRESSES',
422             'reportable'=>false,
423             'unified_search' => true,
424             'rel_fields' => array('primary_address' => array('type'=>'bool')),
425         ),
426 ), 
427 'relationships'=>array(
428     strtolower($module).'_email_addresses' => 
429     array(
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
436     ),
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'
444     ),
445 )
446 );
447 ?>