]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/SugarObjects/templates/basic/vardefs.php
Release 6.5.0
[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         'full_text_search' => array('boost' => 3),
58         'required'=>true,
59                 'importable' => 'required',
60         'duplicate_merge' => 'enabled',
61         //'duplicate_merge_dom_value' => '3',
62         'merge_filter' => 'selected',
63             ),
64           'date_entered' =>
65           array (
66             'name' => 'date_entered',
67             'vname' => 'LBL_DATE_ENTERED',
68             'type' => 'datetime',
69             'group'=>'created_by_name',
70             'comment' => 'Date record created',
71             'enable_range_search' => true,
72                 'options' => 'date_range_search_dom',
73           ),
74           'date_modified' =>
75           array (
76             'name' => 'date_modified',
77             'vname' => 'LBL_DATE_MODIFIED',
78             'type' => 'datetime',
79             'group'=>'modified_by_name',
80             'comment' => 'Date record last modified',
81             'enable_range_search' => true,
82             'options' => 'date_range_search_dom',
83           ),
84                 'modified_user_id' =>
85           array (
86             'name' => 'modified_user_id',
87             'rname' => 'user_name',
88             'id_name' => 'modified_user_id',
89             'vname' => 'LBL_MODIFIED',
90             'type' => 'assigned_user_name',
91             'table' => 'users',
92             'isnull' => 'false',
93              'group'=>'modified_by_name',
94             'dbType' => 'id',
95             'reportable'=>true,
96             'comment' => 'User who last modified record',
97         'massupdate' => false,
98           ),
99           'modified_by_name' => 
100           array (
101             'name' => 'modified_by_name',
102             'vname' => 'LBL_MODIFIED_NAME',
103             'type' => 'relate',
104             'reportable'=>false,
105             'source'=>'non-db',
106             'rname'=>'user_name',
107             'table' => 'users',
108             'id_name' => 'modified_user_id',
109             'module'=>'Users',
110             'link'=>'modified_user_link',
111             'duplicate_merge'=>'disabled',
112         'massupdate' => false,
113           ),  
114           'created_by' =>
115           array (
116             'name' => 'created_by',
117             'rname' => 'user_name',
118             'id_name' => 'modified_user_id',
119             'vname' => 'LBL_CREATED',
120             'type' => 'assigned_user_name',
121             'table' => 'users',
122             'isnull' => 'false',
123             'dbType' => 'id',
124             'group'=>'created_by_name',
125             'comment' => 'User who created record',
126         'massupdate' => false,
127           ),
128                 'created_by_name' => 
129           array (
130             'name' => 'created_by_name',
131                 'vname' => 'LBL_CREATED',
132                 'type' => 'relate',
133                 'reportable'=>false,
134             'link' => 'created_by_link',
135             'rname' => 'user_name',
136                 'source'=>'non-db',
137                 'table' => 'users',
138                 'id_name' => 'created_by',
139                 'module'=>'Users',
140                 'duplicate_merge'=>'disabled',
141         'importable' => 'false',
142         'massupdate' => false,
143         ),
144           'description' =>
145           array (
146             'name' => 'description',
147             'vname' => 'LBL_DESCRIPTION',
148             'type' => 'text',
149             'comment' => 'Full text of the note',
150             'rows' => 6,
151             'cols' => 80,
152           ),
153           'deleted' =>
154           array (
155             'name' => 'deleted',
156             'vname' => 'LBL_DELETED',
157             'type' => 'bool',
158             'default' => '0',
159             'reportable'=>false,
160             'comment' => 'Record deletion indicator'
161           ),
162             
163 /////////////////RELATIONSHIP LINKS////////////////////////////
164           'created_by_link' =>
165   array (
166      'name' => 'created_by_link',
167     'type' => 'link',
168     'relationship' => strtolower($module) . '_created_by',
169     'vname' => 'LBL_CREATED_USER',
170     'link_type' => 'one',
171     'module'=>'Users',
172     'bean_name'=>'User',
173     'source'=>'non-db',
174   ),
175   'modified_user_link' =>
176   array (
177         'name' => 'modified_user_link',
178     'type' => 'link',
179     'relationship' => strtolower($module). '_modified_user',
180     'vname' => 'LBL_MODIFIED_USER',
181     'link_type' => 'one',
182     'module'=>'Users',
183     'bean_name'=>'User',
184     'source'=>'non-db',
185   ),
186
187 ),
188 'indices' => array (
189        'id'=>array('name' =>strtolower($module).'pk', 'type' =>'primary', 'fields'=>array('id')),
190        ),
191 'relationships'=>array(
192         strtolower($module).'_modified_user' =>
193    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
194    'rhs_module'=> $module, 'rhs_table'=> strtolower($module), 'rhs_key' => 'modified_user_id',
195    'relationship_type'=>'one-to-many')
196    ,strtolower($module).'_created_by' =>
197    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
198    'rhs_module'=> $module, 'rhs_table'=> strtolower($module), 'rhs_key' => 'created_by',
199    'relationship_type'=>'one-to-many')
200 ),
201
202
203 );
204 ?>