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