]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/SugarObjects/templates/basic/vardefs.php
Release 6.4.4
[Github/sugarcrm.git] / include / SugarObjects / templates / basic / vardefs.php
1 <?php
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
5  * 
6  * This program is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  * 
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
16  * details.
17  * 
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  * 
23  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
25  * 
26  * The interactive user interfaces in modified source and object code versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  * 
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the "Powered by
32  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33  * technical reasons, the Appropriate Legal Notices must display the words
34  * "Powered by SugarCRM".
35  ********************************************************************************/
36
37 $vardefs = array(  
38 'fields' => array (
39           'id' =>
40           array (
41             'name' => 'id',
42             'vname' => 'LBL_ID',
43             'type' => 'id',
44             'required'=>true,
45             'reportable'=>true,
46             'comment' => 'Unique identifier'
47           ),
48           'name'=>
49             array(
50             'name'=>'name',
51             'vname'=> 'LBL_NAME',
52             'type'=>'name',
53             'link' => true, // bug 39288 
54                 'dbType' => 'varchar',
55             'len'=>255,
56         'unified_search' => true,
57         'required'=>true,
58                 'importable' => 'required',
59         'duplicate_merge' => 'enabled',
60         //'duplicate_merge_dom_value' => '3',
61         'merge_filter' => 'selected',
62             ),
63           'date_entered' =>
64           array (
65             'name' => 'date_entered',
66             'vname' => 'LBL_DATE_ENTERED',
67             'type' => 'datetime',
68             'group'=>'created_by_name',
69             'comment' => 'Date record created',
70             'enable_range_search' => true,
71                 'options' => 'date_range_search_dom',
72           ),
73           'date_modified' =>
74           array (
75             'name' => 'date_modified',
76             'vname' => 'LBL_DATE_MODIFIED',
77             'type' => 'datetime',
78             'group'=>'modified_by_name',
79             'comment' => 'Date record last modified',
80             'enable_range_search' => true,
81             'options' => 'date_range_search_dom',
82           ),
83                 'modified_user_id' =>
84           array (
85             'name' => 'modified_user_id',
86             'rname' => 'user_name',
87             'id_name' => 'modified_user_id',
88             'vname' => 'LBL_MODIFIED',
89             'type' => 'assigned_user_name',
90             'table' => 'users',
91             'isnull' => 'false',
92              'group'=>'modified_by_name',
93             'dbType' => 'id',
94             'reportable'=>true,
95             'comment' => 'User who last modified record',
96         'massupdate' => false,
97           ),
98           'modified_by_name' => 
99           array (
100             'name' => 'modified_by_name',
101             'vname' => 'LBL_MODIFIED_NAME',
102             'type' => 'relate',
103             'reportable'=>false,
104             'source'=>'non-db',
105             'rname'=>'user_name',
106             'table' => 'users',
107             'id_name' => 'modified_user_id',
108             'module'=>'Users',
109             'link'=>'modified_user_link',
110             'duplicate_merge'=>'disabled',
111         'massupdate' => false,
112           ),  
113           'created_by' =>
114           array (
115             'name' => 'created_by',
116             'rname' => 'user_name',
117             'id_name' => 'modified_user_id',
118             'vname' => 'LBL_CREATED',
119             'type' => 'assigned_user_name',
120             'table' => 'users',
121             'isnull' => 'false',
122             'dbType' => 'id',
123             'group'=>'created_by_name',
124             'comment' => 'User who created record',
125         'massupdate' => false,
126           ),
127                 'created_by_name' => 
128           array (
129             'name' => 'created_by_name',
130                 'vname' => 'LBL_CREATED',
131                 'type' => 'relate',
132                 'reportable'=>false,
133             'link' => 'created_by_link',
134             'rname' => 'user_name',
135                 'source'=>'non-db',
136                 'table' => 'users',
137                 'id_name' => 'created_by',
138                 'module'=>'Users',
139                 'duplicate_merge'=>'disabled',
140         'importable' => 'false',
141         'massupdate' => false,
142         ),
143           'description' =>
144           array (
145             'name' => 'description',
146             'vname' => 'LBL_DESCRIPTION',
147             'type' => 'text',
148             'comment' => 'Full text of the note',
149             'rows' => 6,
150             'cols' => 80,
151           ),
152           'deleted' =>
153           array (
154             'name' => 'deleted',
155             'vname' => 'LBL_DELETED',
156             'type' => 'bool',
157             'default' => '0',
158             'reportable'=>false,
159             'comment' => 'Record deletion indicator'
160           ),
161             
162 /////////////////RELATIONSHIP LINKS////////////////////////////
163           'created_by_link' =>
164   array (
165      'name' => 'created_by_link',
166     'type' => 'link',
167     'relationship' => strtolower($module) . '_created_by',
168     'vname' => 'LBL_CREATED_USER',
169     'link_type' => 'one',
170     'module'=>'Users',
171     'bean_name'=>'User',
172     'source'=>'non-db',
173   ),
174   'modified_user_link' =>
175   array (
176         'name' => 'modified_user_link',
177     'type' => 'link',
178     'relationship' => strtolower($module). '_modified_user',
179     'vname' => 'LBL_MODIFIED_USER',
180     'link_type' => 'one',
181     'module'=>'Users',
182     'bean_name'=>'User',
183     'source'=>'non-db',
184   ),
185
186 ),
187 'indices' => array (
188        'id'=>array('name' =>strtolower($module).'pk', 'type' =>'primary', 'fields'=>array('id')),
189        ),
190 'relationships'=>array(
191         strtolower($module).'_modified_user' =>
192    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
193    'rhs_module'=> $module, 'rhs_table'=> strtolower($module), 'rhs_key' => 'modified_user_id',
194    'relationship_type'=>'one-to-many')
195    ,strtolower($module).'_created_by' =>
196    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
197    'rhs_module'=> $module, 'rhs_table'=> strtolower($module), 'rhs_key' => 'created_by',
198    'relationship_type'=>'one-to-many')
199 ),
200
201
202 );
203 ?>