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