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