]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Users/vardefs.php
Release 6.4.0
[Github/sugarcrm.git] / modules / Users / vardefs.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38 $dictionary['User'] = array(
39     'table' => 'users',
40     'fields' => array(
41         'id' => array(
42             'name' => 'id',
43             'vname' => 'LBL_ID',
44             'type' => 'id',
45             'required' => true,
46         ) ,
47         'user_name' => array(
48             'name' => 'user_name',
49             'vname' => 'LBL_USER_NAME',
50             'type' => 'user_name',
51             'dbType' => 'varchar',
52             'len' => '60',
53             'importable' => 'required',
54             'required' => true,
55             'studio' => array(
56                'no_duplicate' => true,
57                'editview' => false,
58                'detailview' => true,
59                'quickcreate' => false,
60                'basic_search' => false,
61                'advanced_search' => false,
62                //BEGIN SUGARCRM flav=pro
63                'wirelesseditview' => false,
64                'wirelessdetailview' => true,
65                'wirelesslistview' => false,
66                'wireless_basic_search' => false,
67                'wireless_advanced_search' => false,
68                //END SUGARCRM flav=pro
69                ),
70         ) ,
71         'user_hash' => array(
72             'name' => 'user_hash',
73             'vname' => 'LBL_USER_HASH',
74             'type' => 'varchar',
75             'len' => '32',
76             'reportable' => false,
77             'importable' => 'false',
78             'studio' => array('no_duplicate'=>true, 'listview' => false, 'searchview'=>false),
79         ) ,
80         'system_generated_password' => array(
81             'name' => 'system_generated_password',
82             'vname' => 'LBL_SYSTEM_GENERATED_PASSWORD',
83             'type' => 'bool',
84             'required' => true,
85             'reportable' => false,
86             'massupdate' => false,
87             'studio' => array('listview' => false, 'searchview'=>false, 'editview'=>false, 'quickcreate'=>false, 'wirelesseditview' => false),
88         ) ,
89
90         'pwd_last_changed' => array(
91             'name' => 'pwd_last_changed',
92             'vname' => 'LBL_PSW_MODIFIED',
93             'type' => 'datetime',
94             'required' => false,
95             'massupdate' => false,
96         ) ,
97         /**
98          * authenticate_id is used by authentication plugins so they may place a quick lookup key for looking up a given user after authenticating through the plugin
99          */
100         'authenticate_id' => array(
101             'name' => 'authenticate_id',
102             'vname' => 'LBL_AUTHENTICATE_ID',
103             'type' => 'varchar',
104             'len' => '100',
105             'reportable' => false,
106             'importable' => 'false',
107             'studio' => array('listview' => false, 'searchview'=>false),
108         ) ,
109         /**
110          * sugar_login will force the user to use sugar authentication
111          * regardless of what authentication the system is configured to use
112          */
113         'sugar_login' => array(
114             'name' => 'sugar_login',
115             'vname' => 'LBL_SUGAR_LOGIN',
116             'type' => 'bool',
117             'default' => '1',
118             'reportable' => false,
119             'massupdate' => false,
120             'importable' => false,
121             'studio' => array('listview' => false, 'searchview'=>false),
122         ) ,
123         'first_name' => array(
124             'name' => 'first_name',
125             'vname' => 'LBL_FIRST_NAME',
126             'dbType' => 'varchar',
127             'type' => 'name',
128             'len' => '30',
129         ) ,
130         'last_name' => array(
131             'name' => 'last_name',
132             'vname' => 'LBL_LAST_NAME',
133             'dbType' => 'varchar',
134             'type' => 'name',
135             'len' => '30',
136             'importable' => 'required',
137                 'required' => true,
138         ) ,
139         'full_name' => array(
140             'name' => 'full_name',
141             'rname' => 'full_name',
142             'vname' => 'LBL_NAME',
143             'type' => 'name',
144             'fields' => array(
145                 'first_name',
146                 'last_name'
147             ) ,
148             'source' => 'non-db',
149             'sort_on' => 'last_name',
150             'sort_on2' => 'first_name',
151             'db_concat_fields' => array(
152                 0 => 'first_name',
153                 1 => 'last_name'
154             ) ,
155             'len' => '510',
156         ) ,
157         'name' => array(
158             'name' => 'name',
159             'rname' => 'name',
160             'vname' => 'LBL_NAME',
161             'type' => 'varchar',
162             'source' => 'non-db',
163             'len' => '510',
164             'db_concat_fields' => array(
165                 0 => 'first_name',
166                 1 => 'last_name'
167             ) ,
168             'importable' => 'false',
169         ) ,
170         'is_admin' => array(
171             'name' => 'is_admin',
172             'vname' => 'LBL_IS_ADMIN',
173             'type' => 'bool',
174             'default' => '0',
175             'studio' => array('listview' => false, 'searchview'=>false),
176         ) ,
177         'external_auth_only' => array(
178             'name' => 'external_auth_only',
179             'vname' => 'LBL_EXT_AUTHENTICATE',
180             'type' => 'bool',
181             'reportable' => false,
182             'massupdate' => false,
183             'default' => '0',
184             'studio' => array('listview' => false, 'searchview'=>false),
185         ) ,
186         'receive_notifications' => array(
187             'name' => 'receive_notifications',
188             'vname' => 'LBL_RECEIVE_NOTIFICATIONS',
189             'type' => 'bool',
190             'default' => '1',
191             'massupdate' => false,
192             'studio' => false,
193         ) ,
194         'description' => array(
195             'name' => 'description',
196             'vname' => 'LBL_DESCRIPTION',
197             'type' => 'text',
198         ) ,
199         'date_entered' => array(
200             'name' => 'date_entered',
201             'vname' => 'LBL_DATE_ENTERED',
202             'type' => 'datetime',
203             'required' => true,
204             'studio' => array('editview' => false, 'quickcreate' => false, 'wirelesseditview' => false),
205         ) ,
206         'date_modified' => array(
207             'name' => 'date_modified',
208             'vname' => 'LBL_DATE_MODIFIED',
209             'type' => 'datetime',
210             'required' => true,
211             'studio' => array('editview' => false, 'quickcreate' => false, 'wirelesseditview' => false),
212         ) ,
213         'modified_user_id' => array(
214             'name' => 'modified_user_id',
215             'rname' => 'user_name',
216             'id_name' => 'modified_user_id',
217             'vname' => 'LBL_MODIFIED_BY_ID',
218             'type' => 'assigned_user_name',
219             'table' => 'users',
220             'isnull' => 'false',
221             'dbType' => 'id',
222         ) ,
223         'modified_by_name' => array(
224             'name' => 'modified_by_name',
225             'vname' => 'LBL_MODIFIED_BY',
226             'type' => 'varchar',
227             'source' => 'non-db',
228         ) ,
229         'created_by' => array(
230             'name' => 'created_by',
231             'rname' => 'user_name',
232             'id_name' => 'modified_user_id',
233             'vname' => 'LBL_ASSIGNED_TO',
234             'type' => 'assigned_user_name',
235             'table' => 'users',
236             'isnull' => 'false',
237             'dbType' => 'id',
238             'studio' => false,
239         ) ,
240         'created_by_name' => array(
241             'name' => 'created_by_name',
242             'vname' => 'LBL_CREATED_BY_NAME', //bug 48978
243             'type' => 'varchar',
244             'source' => 'non-db',
245             'importable' => 'false',
246         ) ,
247         'title' => array(
248             'name' => 'title',
249             'vname' => 'LBL_TITLE',
250             'type' => 'varchar',
251             'len' => '50',
252         ) ,
253         'department' => array(
254             'name' => 'department',
255             'vname' => 'LBL_DEPARTMENT',
256             'type' => 'varchar',
257             'len' => '50',
258         ) ,
259         'phone_home' => array(
260             'name' => 'phone_home',
261             'vname' => 'LBL_HOME_PHONE',
262             'type' => 'phone',
263                         'dbType' => 'varchar',
264             'len' => '50',
265         ) ,
266         'phone_mobile' => array(
267             'name' => 'phone_mobile',
268             'vname' => 'LBL_MOBILE_PHONE',
269             'type' => 'phone',
270                         'dbType' => 'varchar',
271             'len' => '50',
272         ) ,
273         'phone_work' => array(
274             'name' => 'phone_work',
275             'vname' => 'LBL_WORK_PHONE',
276             'type' => 'phone',
277                         'dbType' => 'varchar',
278             'len' => '50',
279         ) ,
280         'phone_other' => array(
281             'name' => 'phone_other',
282             'vname' => 'LBL_OTHER_PHONE',
283             'type' => 'phone',
284                         'dbType' => 'varchar',
285             'len' => '50',
286         ) ,
287         'phone_fax' => array(
288             'name' => 'phone_fax',
289             'vname' => 'LBL_FAX_PHONE',
290             'type' => 'phone',
291                         'dbType' => 'varchar',
292             'len' => '50',
293         ) ,
294         'status' => array(
295             'name' => 'status',
296             'vname' => 'LBL_STATUS',
297             'type' => 'enum',
298             'len' => 100,
299             'options' => 'user_status_dom',
300             'importable' => 'required',
301             'required' => true,
302         ) ,
303         'address_street' => array(
304             'name' => 'address_street',
305             'vname' => 'LBL_ADDRESS_STREET',
306             'type' => 'varchar',
307             'len' => '150',
308         ) ,
309         'address_city' => array(
310             'name' => 'address_city',
311             'vname' => 'LBL_ADDRESS_CITY',
312             'type' => 'varchar',
313             'len' => '100',
314         ) ,
315         'address_state' => array(
316             'name' => 'address_state',
317             'vname' => 'LBL_ADDRESS_STATE',
318             'type' => 'varchar',
319             'len' => '100',
320         ) ,
321         'address_country' => array(
322             'name' => 'address_country',
323             'vname' => 'LBL_ADDRESS_COUNTRY',
324             'type' => 'varchar',
325             'len' => 100,
326         ) ,
327         'address_postalcode' => array(
328             'name' => 'address_postalcode',
329             'vname' => 'LBL_ADDRESS_POSTALCODE',
330             'type' => 'varchar',
331             'len' => '20',
332         ) ,
333         // This is a fake field for the edit view
334         'UserType' => array(
335             'name' => 'UserType',
336             'vname' => 'LBL_USER_TYPE',
337             'type' => 'enum',
338             'len' => 50,
339             'options' => 'user_type_dom',
340             'source' => 'non-db',
341             'import' => false,
342             'reportable' => false,
343         ),
344         'deleted' => array(
345             'name' => 'deleted',
346             'vname' => 'LBL_DELETED',
347             'type' => 'bool',
348             'required' => false,
349             'reportable' => false,
350         ) ,
351         'portal_only' => array(
352             'name' => 'portal_only',
353             'vname' => 'LBL_PORTAL_ONLY_USER',
354             'type' => 'bool',
355             'massupdate' => false,
356             'default' => '0',
357             'studio' => array('listview' => false, 'searchview'=>false),
358         ) ,
359         'show_on_employees' => array(
360             'name' => 'show_on_employees',
361             'vname' => 'LBL_SHOW_ON_EMPLOYEES',
362             'type' => 'bool',
363             'massupdate' => true,
364             'importable' => true,
365             'default' => true,
366         ) ,
367         'employee_status' => array(
368             'name' => 'employee_status',
369             'vname' => 'LBL_EMPLOYEE_STATUS',
370             'type' => 'varchar',
371             'function' => array(
372                 'name' => 'getEmployeeStatusOptions',
373                 'returns' => 'html',
374                 'include' => 'modules/Employees/EmployeeStatus.php'
375             ) ,
376             'len' => 100,
377         ) ,
378         'messenger_id' => array(
379             'name' => 'messenger_id',
380             'vname' => 'LBL_MESSENGER_ID',
381             'type' => 'varchar',
382             'len' => 100,
383         ) ,
384         'messenger_type' => array(
385             'name' => 'messenger_type',
386             'vname' => 'LBL_MESSENGER_TYPE',
387             'type' => 'enum',
388             'options' => 'messenger_type_dom',
389             'len' => 100,
390         ) ,
391         'calls' => array(
392             'name' => 'calls',
393             'type' => 'link',
394             'relationship' => 'calls_users',
395             'source' => 'non-db',
396             'vname' => 'LBL_CALLS'
397         ) ,
398         'meetings' => array(
399             'name' => 'meetings',
400             'type' => 'link',
401             'relationship' => 'meetings_users',
402             'source' => 'non-db',
403             'vname' => 'LBL_MEETINGS'
404         ) ,
405         'contacts_sync' => array(
406             'name' => 'contacts_sync',
407             'type' => 'link',
408             'relationship' => 'contacts_users',
409             'source' => 'non-db',
410             'vname' => 'LBL_CONTACTS_SYNC',
411             'reportable' => false,
412         ) ,
413         'reports_to_id' => array(
414             'name' => 'reports_to_id',
415             'vname' => 'LBL_REPORTS_TO_ID',
416             'type' => 'id',
417             'required' => false,
418         ) ,
419         'reports_to_name' => array(
420             'name' => 'reports_to_name',
421             'rname' => 'last_name',
422             'id_name' => 'reports_to_id',
423             'vname' => 'LBL_REPORTS_TO_NAME',
424             'type' => 'relate',
425             'isnull' => 'true',
426             'module' => 'Users',
427             'table' => 'users',
428             'link' => 'reports_to_link',
429             'reportable' => false,
430             'source' => 'non-db',
431             'duplicate_merge' => 'disabled',
432             'side' => 'right',
433         ) ,
434         'reports_to_link' => array(
435             'name' => 'reports_to_link',
436             'type' => 'link',
437             'relationship' => 'user_direct_reports',
438             'link_type' => 'one',
439             'side' => 'right',
440             'source' => 'non-db',
441             'vname' => 'LBL_REPORTS_TO',
442         ) ,
443         'reportees' => array(
444             'name' => 'reportees',
445             'type' => 'link',
446             'relationship' => 'user_direct_reports',
447             'link_type' => 'many',
448             'side' => 'left',
449             'source' => 'non-db',
450             'vname' => 'LBL_REPORTS_TO',
451             'reportable' => false,
452         ) ,
453         'email1' => array(
454             'name' => 'email1',
455             'vname' => 'LBL_EMAIL',
456             'type' => 'varchar',
457             'function' => array(
458                 'name' => 'getEmailAddressWidget',
459                 'returns' => 'html'
460             ) ,
461             'source' => 'non-db',
462             'group' => 'email1',
463             'merge_filter' => 'enabled',
464             'required' => true,
465         ) ,
466         'email_addresses' => array(
467             'name' => 'email_addresses',
468             'type' => 'link',
469             'relationship' => 'users_email_addresses',
470             'module' => 'EmailAddress',
471             'bean_name' => 'EmailAddress',
472             'source' => 'non-db',
473             'vname' => 'LBL_EMAIL_ADDRESSES',
474             'reportable' => false,
475             'required' => true,
476         ) ,
477         'email_addresses_primary' => array(
478             'name' => 'email_addresses_primary',
479             'type' => 'link',
480             'relationship' => 'users_email_addresses_primary',
481             'source' => 'non-db',
482             'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
483             'duplicate_merge' => 'disabled',
484             'required' => true,
485         ),
486         /* Virtual email fields so they will display on the main user page */
487         'email_link_type' => array(
488             'name' => 'email_link_type',
489             'vname' => 'LBL_EMAIL_LINK_TYPE',
490             'type' => 'enum',
491             'options' => 'dom_email_link_type',
492             'importable' => false,
493             'reportable' => false,
494             'source' => 'non-db',
495             'studio' => false,
496         ),
497         
498         'aclroles' => array(
499             'name' => 'aclroles',
500             'type' => 'link',
501             'relationship' => 'acl_roles_users',
502             'source' => 'non-db',
503             'side' => 'right',
504             'vname' => 'LBL_ROLES',
505         ) ,
506         'is_group' => array(
507             'name' => 'is_group',
508             'vname' => 'LBL_GROUP_USER',
509             'type' => 'bool',
510             'massupdate' => false,
511             'studio' => array('listview' => false, 'searchview'=>false),
512         ) ,
513         /* to support Meetings SubPanels */
514         'c_accept_status_fields' => array(
515             'name' => 'c_accept_status_fields',
516             'rname' => 'id',
517             'relationship_fields' => array(
518                 'id' => 'accept_status_id',
519                 'accept_status' => 'accept_status_name'
520             ) ,
521             'vname' => 'LBL_LIST_ACCEPT_STATUS',
522             'type' => 'relate',
523             'link' => 'calls',
524             'link_type' => 'relationship_info',
525             'source' => 'non-db',
526             'importable' => 'false',
527             'studio' => array('listview' => false, 'searchview'=>false),
528         ) ,
529         'm_accept_status_fields' => array(
530             'name' => 'm_accept_status_fields',
531             'rname' => 'id',
532             'relationship_fields' => array(
533                 'id' => 'accept_status_id',
534                 'accept_status' => 'accept_status_name'
535             ) ,
536             'vname' => 'LBL_LIST_ACCEPT_STATUS',
537             'type' => 'relate',
538             'link' => 'meetings',
539             'link_type' => 'relationship_info',
540             'source' => 'non-db',
541             'importable' => 'false',
542             'studio' => array('listview' => false, 'searchview'=>false),
543         ) ,
544         'accept_status_id' => array(
545             'name' => 'accept_status_id',
546             'type' => 'varchar',
547             'source' => 'non-db',
548             'vname' => 'LBL_LIST_ACCEPT_STATUS',
549             'importable' => 'false',
550                 'studio' => array('listview' => false, 'searchview'=>false),
551         ) ,
552         'accept_status_name' => array(
553             'name' => 'accept_status_name',
554             'type' => 'enum',
555             'source' => 'non-db',
556             'vname' => 'LBL_LIST_ACCEPT_STATUS',
557             'options' => 'dom_meeting_accept_status',
558             'massupdate' => false,
559             'studio' => array('listview' => false, 'searchview'=>false),
560         ) ,
561         'prospect_lists' => array(
562             'name' => 'prospect_lists',
563             'type' => 'link',
564             'relationship' => 'prospect_list_users',
565             'module' => 'ProspectLists',
566             'source' => 'non-db',
567             'vname' => 'LBL_PROSPECT_LIST',
568         ) ,
569         'emails_users' => array(
570             'name' => 'emails_users',
571             'type' => 'link',
572             'relationship' => 'emails_users_rel',
573             'module' => 'Emails',
574             'source' => 'non-db',
575             'vname' => 'LBL_EMAILS'
576         ),
577         'holidays' => array(
578             'name' => 'holidays',
579             'type' => 'link',
580             'relationship' => 'users_holidays',
581             'source' => 'non-db',
582             'side' => 'right',
583             'vname' => 'LBL_HOLIDAYS',
584         ) ,
585        'eapm' =>
586                   array (
587                     'name' => 'eapm',
588                     'type' => 'link',
589                     'relationship' => 'eapm_assigned_user',
590                     'vname' => 'LBL_ASSIGNED_TO_USER',
591                     'source'=>'non-db',
592                   ),
593          'oauth_tokens' =>
594       array (
595         'name' => 'oauth_tokens',
596         'type' => 'link',
597         'relationship' => 'oauthtokens_assigned_user',
598         'vname' => 'LBL_OAUTH_TOKENS',
599         'link_type' => 'one',
600         'module'=>'OAuthTokens',
601         'bean_name'=>'OAuthToken',
602         'source'=>'non-db',
603         'side' => 'left',
604       ),
605         'project_resource'=>
606                 array (
607                         'name' => 'project_resource',
608                         'type' => 'link',
609                         'relationship' => 'projects_users_resources',
610                         'source' => 'non-db',
611                         'vname' => 'LBL_PROJECTS',
612                 ),
613     ) ,
614     'indices' => array(
615         array(
616             'name' => 'userspk',
617             'type' => 'primary',
618             'fields' => array(
619                 'id'
620             )
621         ) ,
622         array(
623             'name' => 'idx_user_name',
624             'type' => 'index',
625             'fields' => array(
626                 'user_name',
627                 'is_group',
628                 'status',
629                 'last_name',
630                 'first_name',
631                 'id'
632             )
633         ) ,
634     ) ,
635         'relationships' => array (
636                 'user_direct_reports' => array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id', 'rhs_module'=> 'Users', 'rhs_table'=> 'users', 'rhs_key' => 'reports_to_id', 'relationship_type'=>'one-to-many'),
637                 'users_users_signatures' =>
638                    array(
639                        'lhs_module'=> 'Users',
640                        'lhs_table'=> 'users',
641                        'lhs_key' => 'id',
642                        'rhs_module'=> 'UserSignature',
643                        'rhs_table'=> 'users_signatures',
644                        'rhs_key' => 'user_id',
645                        'relationship_type'=>'one-to-many'
646                        ),
647         'users_email_addresses' =>
648                     array(
649                         'lhs_module'=> "Users", 'lhs_table'=> 'users', 'lhs_key' => 'id',
650                         'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
651                         'relationship_type'=>'many-to-many',
652                         'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
653                         'relationship_role_column'=>'bean_module',
654                         'relationship_role_column_value'=>"Users"
655                     ),
656                 'users_email_addresses_primary' =>
657                     array('lhs_module'=> "Users", 'lhs_table'=> 'users', 'lhs_key' => 'id',
658                         'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
659                         'relationship_type'=>'many-to-many',
660                         'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
661                         'relationship_role_column'=>'primary_address',
662                         'relationship_role_column_value'=>'1'
663                     ),
664     ),
665
666
667
668 );