]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Users/vardefs.php
Release 6.3.1
[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         ) ,
55         'user_hash' => array(
56             'name' => 'user_hash',
57             'vname' => 'LBL_USER_HASH',
58             'type' => 'varchar',
59             'len' => '32',
60             'reportable' => false,
61             'importable' => 'false',
62         ) ,
63         'system_generated_password' => array(
64             'name' => 'system_generated_password',
65             'vname' => 'LBL_SYSTEM_GENERATED_PASSWORD',
66             'type' => 'bool',
67             'required' => true,
68             'reportable' => false,
69             'massupdate' => false,
70         ) ,
71
72         'pwd_last_changed' => array(
73             'name' => 'pwd_last_changed',
74             'vname' => 'LBL_PSW_MODIFIED',
75             'type' => 'datetime',
76             'required' => false,
77             'massupdate' => false,
78         ) ,
79         /**
80          * 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
81          */
82         'authenticate_id' => array(
83             'name' => 'authenticate_id',
84             'vname' => 'LBL_AUTHENTICATE_ID',
85             'type' => 'varchar',
86             'len' => '100',
87             'reportable' => false,
88             'importable' => 'false',
89         ) ,
90         /**
91          * sugar_login will force the user to use sugar authentication
92          * regardless of what authentication the system is configured to use
93          */
94         'sugar_login' => array(
95             'name' => 'sugar_login',
96             'vname' => 'LBL_SUGAR_LOGIN',
97             'type' => 'bool',
98             'default' => '1',
99             'reportable' => false,
100             'massupdate' => false,
101             'importable' => false,
102         ) ,
103         'first_name' => array(
104             'name' => 'first_name',
105             'vname' => 'LBL_FIRST_NAME',
106             'dbType' => 'varchar',
107             'type' => 'name',
108             'len' => '30',
109         ) ,
110         'last_name' => array(
111             'name' => 'last_name',
112             'vname' => 'LBL_LAST_NAME',
113             'dbType' => 'varchar',
114             'type' => 'name',
115             'len' => '30',
116             'importable' => 'required',
117                 'required' => true,
118         ) ,
119         'full_name' => array(
120             'name' => 'full_name',
121             'rname' => 'full_name',
122             'vname' => 'LBL_NAME',
123             'type' => 'name',
124             'fields' => array(
125                 'first_name',
126                 'last_name'
127             ) ,
128             'source' => 'non-db',
129             'sort_on' => 'last_name',
130             'sort_on2' => 'first_name',
131             'db_concat_fields' => array(
132                 0 => 'first_name',
133                 1 => 'last_name'
134             ) ,
135             'len' => '510',
136         ) ,
137         'name' => array(
138             'name' => 'name',
139             'rname' => 'name',
140             'vname' => 'LBL_NAME',
141             'type' => 'varchar',
142             'source' => 'non-db',
143             'len' => '510',
144             'db_concat_fields' => array(
145                 0 => 'first_name',
146                 1 => 'last_name'
147             ) ,
148             'importable' => 'false',
149         ) ,
150         'reports_to_id' => array(
151             'name' => 'reports_to_id',
152             'vname' => 'LBL_REPORTS_TO_ID',
153             'type' => 'id',
154             'required' => false,
155         ) ,
156         'reports_to_name' => array(
157             'name' => 'reports_to_name',
158             'vname' => 'LBL_REPORTS_TO_NAME',
159             'type' => 'relate',
160             'reportable' => false,
161             'source' => 'non-db',
162             'table' => 'users',
163             'id_name' => 'reports_to_id',
164             'module' => 'Users',
165             'duplicate_merge' => 'disabled',
166         ) ,
167         'is_admin' => array(
168             'name' => 'is_admin',
169             'vname' => 'LBL_IS_ADMIN',
170             'type' => 'bool',
171             'default' => '0',
172         ) ,
173         'external_auth_only' => array(
174             'name' => 'external_auth_only',
175             'vname' => 'LBL_EXT_AUTHENTICATE',
176             'type' => 'bool',
177             'reportable' => false,
178             'massupdate' => false,
179             'default' => '0',
180         ) ,
181         'receive_notifications' => array(
182             'name' => 'receive_notifications',
183             'vname' => 'LBL_RECEIVE_NOTIFICATIONS',
184             'type' => 'bool',
185             'default' => '1',
186             'massupdate' => false,
187         ) ,
188         'description' => array(
189             'name' => 'description',
190             'vname' => 'LBL_DESCRIPTION',
191             'type' => 'text',
192         ) ,
193         'date_entered' => array(
194             'name' => 'date_entered',
195             'vname' => 'LBL_DATE_ENTERED',
196             'type' => 'datetime',
197             'required' => true,
198         ) ,
199         'date_modified' => array(
200             'name' => 'date_modified',
201             'vname' => 'LBL_DATE_MODIFIED',
202             'type' => 'datetime',
203             'required' => true,
204         ) ,
205         'modified_user_id' => array(
206             'name' => 'modified_user_id',
207             'rname' => 'user_name',
208             'id_name' => 'modified_user_id',
209             'vname' => 'LBL_MODIFIED_BY_ID',
210             'type' => 'assigned_user_name',
211             'table' => 'users',
212             'isnull' => 'false',
213             'dbType' => 'id',
214         ) ,
215         'modified_by_name' => array(
216             'name' => 'modified_by_name',
217             'vname' => 'LBL_MODIFIED_BY',
218             'type' => 'varchar',
219             'source' => 'non-db',
220         ) ,
221         'created_by' => array(
222             'name' => 'created_by',
223             'rname' => 'user_name',
224             'id_name' => 'modified_user_id',
225             'vname' => 'LBL_ASSIGNED_TO',
226             'type' => 'assigned_user_name',
227             'table' => 'users',
228             'isnull' => 'false',
229             'dbType' => 'id'
230         ) ,
231         'created_by_name' => array(
232             'name' => 'created_by_name',
233             'type' => 'varchar',
234             'source' => 'non-db',
235             'importable' => 'false',
236         ) ,
237         'title' => array(
238             'name' => 'title',
239             'vname' => 'LBL_TITLE',
240             'type' => 'varchar',
241             'len' => '50',
242         ) ,
243         'department' => array(
244             'name' => 'department',
245             'vname' => 'LBL_DEPARTMENT',
246             'type' => 'varchar',
247             'len' => '50',
248         ) ,
249         'phone_home' => array(
250             'name' => 'phone_home',
251             'vname' => 'LBL_HOME_PHONE',
252             'type' => 'phone',
253                         'dbType' => 'varchar',
254             'len' => '50',
255         ) ,
256         'phone_mobile' => array(
257             'name' => 'phone_mobile',
258             'vname' => 'LBL_MOBILE_PHONE',
259             'type' => 'phone',
260                         'dbType' => 'varchar',
261             'len' => '50',
262         ) ,
263         'phone_work' => array(
264             'name' => 'phone_work',
265             'vname' => 'LBL_WORK_PHONE',
266             'type' => 'phone',
267                         'dbType' => 'varchar',
268             'len' => '50',
269         ) ,
270         'phone_other' => array(
271             'name' => 'phone_other',
272             'vname' => 'LBL_OTHER_PHONE',
273             'type' => 'phone',
274                         'dbType' => 'varchar',
275             'len' => '50',
276         ) ,
277         'phone_fax' => array(
278             'name' => 'phone_fax',
279             'vname' => 'LBL_FAX_PHONE',
280             'type' => 'phone',
281                         'dbType' => 'varchar',
282             'len' => '50',
283         ) ,
284         'status' => array(
285             'name' => 'status',
286             'vname' => 'LBL_STATUS',
287             'type' => 'enum',
288             'len' => 100,
289             'options' => 'user_status_dom',
290             'importable' => 'required',
291         ) ,
292         'address_street' => array(
293             'name' => 'address_street',
294             'vname' => 'LBL_ADDRESS_STREET',
295             'type' => 'varchar',
296             'len' => '150',
297         ) ,
298         'address_city' => array(
299             'name' => 'address_city',
300             'vname' => 'LBL_ADDRESS_CITY',
301             'type' => 'varchar',
302             'len' => '100',
303         ) ,
304         'address_state' => array(
305             'name' => 'address_state',
306             'vname' => 'LBL_ADDRESS_STATE',
307             'type' => 'varchar',
308             'len' => '100',
309         ) ,
310         'address_country' => array(
311             'name' => 'address_country',
312             'vname' => 'LBL_ADDRESS_COUNTRY',
313             'type' => 'varchar',
314             'len' => 100,
315         ) ,
316         'address_postalcode' => array(
317             'name' => 'address_postalcode',
318             'vname' => 'LBL_ADDRESS_POSTALCODE',
319             'type' => 'varchar',
320             'len' => '20',
321         ) ,
322         'deleted' => array(
323             'name' => 'deleted',
324             'vname' => 'LBL_DELETED',
325             'type' => 'bool',
326             'required' => false,
327             'reportable' => false,
328         ) ,
329         'portal_only' => array(
330             'name' => 'portal_only',
331             'vname' => 'LBL_PORTAL_ONLY_USER',
332             'type' => 'bool',
333             'massupdate' => false,
334             'default' => '0'
335         ) ,
336         'employee_status' => array(
337             'name' => 'employee_status',
338             'vname' => 'LBL_EMPLOYEE_STATUS',
339             'type' => 'varchar',
340             'function' => array(
341                 'name' => 'getEmployeeStatusOptions',
342                 'returns' => 'html',
343                 'include' => 'modules/Employees/EmployeeStatus.php'
344             ) ,
345             'len' => 100,
346         ) ,
347         'messenger_id' => array(
348             'name' => 'messenger_id',
349             'vname' => 'LBL_MESSENGER_ID',
350             'type' => 'varchar',
351             'len' => 100,
352         ) ,
353         'messenger_type' => array(
354             'name' => 'messenger_type',
355             'vname' => 'LBL_MESSENGER_TYPE',
356             'type' => 'varchar',
357             'function' => array(
358                 'name' => 'getMessengerTypeOptions',
359                 'returns' => 'html',
360                 'include' => 'modules/Employees/EmployeeStatus.php'
361             ) ,
362             'len' => 100,
363         ) ,
364         'calls' => array(
365             'name' => 'calls',
366             'type' => 'link',
367             'relationship' => 'calls_users',
368             'source' => 'non-db',
369             'vname' => 'LBL_CALLS'
370         ) ,
371         'meetings' => array(
372             'name' => 'meetings',
373             'type' => 'link',
374             'relationship' => 'meetings_users',
375             'source' => 'non-db',
376             'vname' => 'LBL_MEETINGS'
377         ) ,
378         'contacts_sync' => array(
379             'name' => 'contacts_sync',
380             'type' => 'link',
381             'relationship' => 'contacts_users',
382             'source' => 'non-db',
383             'vname' => 'LBL_CONTACTS_SYNC',
384             'reportable' => false,
385         ) ,
386         'reports_to_link' => array(
387             'name' => 'reports_to_link',
388             'type' => 'link',
389             'relationship' => 'user_direct_reports',
390             'link_type' => 'one',
391             'side' => 'right',
392             'source' => 'non-db',
393             'vname' => 'LBL_REPORTS_TO',
394         ) ,
395         'reportees' => array(
396             'name' => 'reportees',
397             'type' => 'link',
398             'relationship' => 'user_direct_reports',
399             'link_type' => 'many',
400             'side' => 'left',
401             'source' => 'non-db',
402             'vname' => 'LBL_REPORTS_TO',
403             'reportable' => false,
404         ) ,
405         'email1' => array(
406             'name' => 'email1',
407             'vname' => 'LBL_EMAIL',
408             'type' => 'varchar',
409             'function' => array(
410                 'name' => 'getEmailAddressWidget',
411                 'returns' => 'html'
412             ) ,
413             'source' => 'non-db',
414             'group' => 'email1',
415             'merge_filter' => 'enabled',
416             'required' => true,
417         ) ,
418         'email_addresses' => array(
419             'name' => 'email_addresses',
420             'type' => 'link',
421             'relationship' => 'users_email_addresses',
422             'module' => 'EmailAddress',
423             'bean_name' => 'EmailAddress',
424             'source' => 'non-db',
425             'vname' => 'LBL_EMAIL_ADDRESSES',
426             'reportable' => false,
427             'required' => true,
428         ) ,
429         'email_addresses_primary' => array(
430             'name' => 'email_addresses_primary',
431             'type' => 'link',
432             'relationship' => 'users_email_addresses_primary',
433             'source' => 'non-db',
434             'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
435             'duplicate_merge' => 'disabled',
436             'required' => true,
437         ) ,
438         'aclroles' => array(
439             'name' => 'aclroles',
440             'type' => 'link',
441             'relationship' => 'acl_roles_users',
442             'source' => 'non-db',
443             'side' => 'right',
444             'vname' => 'LBL_ROLES',
445         ) ,
446         'is_group' => array(
447             'name' => 'is_group',
448             'vname' => 'LBL_GROUP_USER',
449             'type' => 'bool',
450             'massupdate' => false,
451         ) ,
452         /* to support Meetings SubPanels */
453         'c_accept_status_fields' => array(
454             'name' => 'c_accept_status_fields',
455             'rname' => 'id',
456             'relationship_fields' => array(
457                 'id' => 'accept_status_id',
458                 'accept_status' => 'accept_status_name'
459             ) ,
460             'vname' => 'LBL_LIST_ACCEPT_STATUS',
461             'type' => 'relate',
462             'link' => 'calls',
463             'link_type' => 'relationship_info',
464             'source' => 'non-db',
465             'importable' => 'false',
466             'studio' => array('listview' => false),
467         ) ,
468         'm_accept_status_fields' => array(
469             'name' => 'm_accept_status_fields',
470             'rname' => 'id',
471             'relationship_fields' => array(
472                 'id' => 'accept_status_id',
473                 'accept_status' => 'accept_status_name'
474             ) ,
475             'vname' => 'LBL_LIST_ACCEPT_STATUS',
476             'type' => 'relate',
477             'link' => 'meetings',
478             'link_type' => 'relationship_info',
479             'source' => 'non-db',
480             'importable' => 'false',
481             'studio' => array('listview' => false),
482         ) ,
483         'accept_status_id' => array(
484             'name' => 'accept_status_id',
485             'type' => 'varchar',
486             'source' => 'non-db',
487             'vname' => 'LBL_LIST_ACCEPT_STATUS',
488             'importable' => 'false',
489                 'studio' => array('listview' => false),
490         ) ,
491         'accept_status_name' => array(
492             'name' => 'accept_status_name',
493             'type' => 'enum',
494             'source' => 'non-db',
495             'vname' => 'LBL_LIST_ACCEPT_STATUS',
496             'options' => 'dom_meeting_accept_status',
497             'massupdate' => false,
498         ) ,
499         'prospect_lists' => array(
500             'name' => 'prospect_lists',
501             'type' => 'link',
502             'relationship' => 'prospect_list_users',
503             'module' => 'ProspectLists',
504             'source' => 'non-db',
505             'vname' => 'LBL_PROSPECT_LIST',
506         ) ,
507         'emails_users' => array(
508             'name' => 'emails_users',
509             'type' => 'link',
510             'relationship' => 'emails_users_rel',
511             'module' => 'Emails',
512             'source' => 'non-db',
513             'vname' => 'LBL_EMAILS'
514         ),
515         'holidays' => array(
516             'name' => 'holidays',
517             'type' => 'link',
518             'relationship' => 'users_holidays',
519             'source' => 'non-db',
520             'side' => 'right',
521             'vname' => 'LBL_HOLIDAYS',
522         ) ,
523        'eapm' =>
524                   array (
525                     'name' => 'eapm',
526                     'type' => 'link',
527                     'relationship' => 'eapm_assigned_user',
528                     'vname' => 'LBL_ASSIGNED_TO_USER',
529                     'source'=>'non-db',
530                   ),
531          'oauth_tokens' =>
532       array (
533         'name' => 'oauth_tokens',
534         'type' => 'link',
535         'relationship' => 'oauthtokens_assigned_user',
536         'vname' => 'LBL_OAUTH_TOKENS',
537         'link_type' => 'one',
538         'module'=>'OAuthTokens',
539         'bean_name'=>'OAuthToken',
540         'source'=>'non-db',
541         'side' => 'left',
542       ),
543         'project_resource'=>
544                 array (
545                         'name' => 'project_resource',
546                         'type' => 'link',
547                         'relationship' => 'projects_users_resources',
548                         'source' => 'non-db',
549                         'vname' => 'LBL_PROJECTS',
550                 ),
551     ) ,
552     'indices' => array(
553         array(
554             'name' => 'userspk',
555             'type' => 'primary',
556             'fields' => array(
557                 'id'
558             )
559         ) ,
560         array(
561             'name' => 'idx_user_name',
562             'type' => 'index',
563             'fields' => array(
564                 'user_name',
565                 'is_group',
566                 'status',
567                 'last_name',
568                 'first_name',
569                 'id'
570             )
571         ) ,
572     ) ,
573         'relationships' => array (
574                 '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'),
575                 'users_users_signatures' =>
576                    array(
577                        'lhs_module'=> 'Users',
578                        'lhs_table'=> 'users',
579                        'lhs_key' => 'id',
580                        'rhs_module'=> 'UserSignature',
581                        'rhs_table'=> 'users_signatures',
582                        'rhs_key' => 'user_id',
583                        'relationship_type'=>'one-to-many'
584                        ),
585         'users_email_addresses' =>
586                     array(
587                         'lhs_module'=> "Users", 'lhs_table'=> 'users', 'lhs_key' => 'id',
588                         'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
589                         'relationship_type'=>'many-to-many',
590                         'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
591                         'relationship_role_column'=>'bean_module',
592                         'relationship_role_column_value'=>"Users"
593                     ),
594                 'users_email_addresses_primary' =>
595                     array('lhs_module'=> "Users", 'lhs_table'=> 'users', 'lhs_key' => 'id',
596                         'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
597                         'relationship_type'=>'many-to-many',
598                         'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
599                         'relationship_role_column'=>'primary_address',
600                         'relationship_role_column_value'=>'1'
601                     ),
602     ),
603
604
605
606 );