]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Users/vardefs.php
Release 6.1.4
[Github/sugarcrm.git] / modules / Users / vardefs.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM 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' => '9',
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',
380             'type' => 'link',
381             'relationship' => 'contacts_users',
382             'source' => 'non-db',
383             'vname' => 'LBL_CONTACTS_SYNC'
384         ) ,
385         'reports_to_link' => array(
386             'name' => 'reports_to_link',
387             'type' => 'link',
388             'relationship' => 'user_direct_reports',
389             'link_type' => 'one',
390             'side' => 'right',
391             'source' => 'non-db',
392             'vname' => 'LBL_REPORTS_TO',
393         ) ,
394         'email1' => array(
395             'name' => 'email1',
396             'vname' => 'LBL_EMAIL',
397             'type' => 'varchar',
398             'function' => array(
399                 'name' => 'getEmailAddressWidget',
400                 'returns' => 'html'
401             ) ,
402             'source' => 'non-db',
403             'group' => 'email1',
404             'merge_filter' => 'enabled',
405             'required' => true,
406         ) ,
407         'email_addresses' => array(
408             'name' => 'email_addresses',
409             'type' => 'link',
410             'relationship' => 'users_email_addresses',
411             'module' => 'EmailAddress',
412             'bean_name' => 'EmailAddress',
413             'source' => 'non-db',
414             'vname' => 'LBL_EMAIL_ADDRESSES',
415             'reportable' => false,
416             'required' => true,
417         ) ,
418         'email_addresses_primary' => array(
419             'name' => 'email_addresses_primary',
420             'type' => 'link',
421             'relationship' => 'users_email_addresses_primary',
422             'source' => 'non-db',
423             'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
424             'duplicate_merge' => 'disabled',
425             'required' => true,
426         ) ,
427         'aclroles' => array(
428             'name' => 'aclroles',
429             'type' => 'link',
430             'relationship' => 'acl_roles_users',
431             'source' => 'non-db',
432             'side' => 'right',
433             'vname' => 'LBL_ROLES',
434         ) ,
435         'is_group' => array(
436             'name' => 'is_group',
437             'vname' => 'LBL_GROUP_USER',
438             'type' => 'bool',
439             'massupdate' => false,
440         ) ,
441         /* to support Meetings SubPanels */
442         'c_accept_status_fields' => array(
443             'name' => 'c_accept_status_fields',
444             'rname' => 'id',
445             'relationship_fields' => array(
446                 'id' => 'accept_status_id',
447                 'accept_status' => 'accept_status_name'
448             ) ,
449             'vname' => 'LBL_LIST_ACCEPT_STATUS',
450             'type' => 'relate',
451             'link' => 'calls',
452             'link_type' => 'relationship_info',
453             'source' => 'non-db',
454             'importable' => 'false',
455             'studio' => array('listview' => false),
456         ) ,
457         'm_accept_status_fields' => array(
458             'name' => 'm_accept_status_fields',
459             'rname' => 'id',
460             'relationship_fields' => array(
461                 'id' => 'accept_status_id',
462                 'accept_status' => 'accept_status_name'
463             ) ,
464             'vname' => 'LBL_LIST_ACCEPT_STATUS',
465             'type' => 'relate',
466             'link' => 'meetings',
467             'link_type' => 'relationship_info',
468             'source' => 'non-db',
469             'importable' => 'false',
470             'studio' => array('listview' => false),
471         ) ,
472         'accept_status_id' => array(
473             'name' => 'accept_status_id',
474             'type' => 'varchar',
475             'source' => 'non-db',
476             'vname' => 'LBL_LIST_ACCEPT_STATUS',
477             'importable' => 'false',
478                 'studio' => array('listview' => false),
479         ) ,
480         'accept_status_name' => array(
481             'name' => 'accept_status_name',
482             'type' => 'enum',
483             'source' => 'non-db',
484             'vname' => 'LBL_LIST_ACCEPT_STATUS',
485             'options' => 'dom_meeting_accept_status',
486             'massupdate' => false,
487         ) ,
488         'prospect_lists' => array(
489             'name' => 'prospect_lists',
490             'type' => 'link',
491             'relationship' => 'prospect_list_users',
492             'module' => 'ProspectLists',
493             'source' => 'non-db',
494             'vname' => 'LBL_PROSPECT_LIST',
495         ) ,
496         'holidays' => array(
497             'name' => 'holidays',
498             'type' => 'link',
499             'relationship' => 'users_holidays',
500             'source' => 'non-db',
501             'side' => 'right',
502             'vname' => 'LBL_HOLIDAYS',
503         ) ,
504         
505     ) ,
506     'indices' => array(
507         array(
508             'name' => 'userspk',
509             'type' => 'primary',
510             'fields' => array(
511                 'id'
512             )
513         ) ,
514         array(
515             'name' => 'idx_user_name',
516             'type' => 'index',
517             'fields' => array(
518                 'user_name',
519                 'is_group',
520                 'status',
521                 'last_name',
522                 'first_name',
523                 'id'
524             )
525         ) ,
526     ) ,
527         'relationships' => array (
528                 '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'),
529                 'users_users_signatures' =>
530                    array(
531                        'lhs_module'=> 'Users',
532                        'lhs_table'=> 'users', 
533                        'lhs_key' => 'id',
534                        'rhs_module'=> 'UserSignature', 
535                        'rhs_table'=> 'users_signatures', 
536                        'rhs_key' => 'user_id',
537                        'relationship_type'=>'one-to-many'
538                        ),
539         'users_email_addresses' => 
540                     array(
541                         'lhs_module'=> "Users", 'lhs_table'=> 'users', 'lhs_key' => 'id',
542                         'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
543                         'relationship_type'=>'many-to-many',
544                         'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id', 
545                         'relationship_role_column'=>'bean_module',
546                         'relationship_role_column_value'=>"Users"
547                     ),
548                 'users_email_addresses_primary' => 
549                     array('lhs_module'=> "Users", 'lhs_table'=> 'users', 'lhs_key' => 'id',
550                         'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
551                         'relationship_type'=>'many-to-many',
552                         'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id', 
553                         'relationship_role_column'=>'primary_address', 
554                         'relationship_role_column_value'=>'1'
555                     ),
556     ),
557
558       
559     
560 );