]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/SugarObjects/templates/basic/vardefs.php
Release 6.4.1
[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           ),
97           'modified_by_name' => 
98           array (
99             'name' => 'modified_by_name',
100             'vname' => 'LBL_MODIFIED_NAME',
101             'type' => 'relate',
102             'reportable'=>false,
103             'source'=>'non-db',
104             'rname'=>'user_name',
105             'table' => 'users',
106             'id_name' => 'modified_user_id',
107             'module'=>'Users',
108             'link'=>'modified_user_link',
109             'duplicate_merge'=>'disabled' 
110           ),  
111           'created_by' =>
112           array (
113             'name' => 'created_by',
114             'rname' => 'user_name',
115             'id_name' => 'modified_user_id',
116             'vname' => 'LBL_CREATED',
117             'type' => 'assigned_user_name',
118             'table' => 'users',
119             'isnull' => 'false',
120             'dbType' => 'id',
121             'group'=>'created_by_name',
122             'comment' => 'User who created record',
123           ),
124                 'created_by_name' => 
125           array (
126             'name' => 'created_by_name',
127                 'vname' => 'LBL_CREATED',
128                 'type' => 'relate',
129                 'reportable'=>false,
130             'link' => 'created_by_link',
131             'rname' => 'user_name',
132                 'source'=>'non-db',
133                 'table' => 'users',
134                 'id_name' => 'created_by',
135                 'module'=>'Users',
136                 'duplicate_merge'=>'disabled',
137         'importable' => 'false',
138         ),
139           'description' =>
140           array (
141             'name' => 'description',
142             'vname' => 'LBL_DESCRIPTION',
143             'type' => 'text',
144             'comment' => 'Full text of the note',
145             'rows' => 6,
146             'cols' => 80,
147           ),
148           'deleted' =>
149           array (
150             'name' => 'deleted',
151             'vname' => 'LBL_DELETED',
152             'type' => 'bool',
153             'default' => '0',
154             'reportable'=>false,
155             'comment' => 'Record deletion indicator'
156           ),
157             
158 /////////////////RELATIONSHIP LINKS////////////////////////////
159           'created_by_link' =>
160   array (
161      'name' => 'created_by_link',
162     'type' => 'link',
163     'relationship' => strtolower($module) . '_created_by',
164     'vname' => 'LBL_CREATED_USER',
165     'link_type' => 'one',
166     'module'=>'Users',
167     'bean_name'=>'User',
168     'source'=>'non-db',
169   ),
170   'modified_user_link' =>
171   array (
172         'name' => 'modified_user_link',
173     'type' => 'link',
174     'relationship' => strtolower($module). '_modified_user',
175     'vname' => 'LBL_MODIFIED_USER',
176     'link_type' => 'one',
177     'module'=>'Users',
178     'bean_name'=>'User',
179     'source'=>'non-db',
180   ),
181
182 ),
183 'indices' => array (
184        'id'=>array('name' =>strtolower($module).'pk', 'type' =>'primary', 'fields'=>array('id')),
185        ),
186 'relationships'=>array(
187         strtolower($module).'_modified_user' =>
188    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
189    'rhs_module'=> $module, 'rhs_table'=> strtolower($module), 'rhs_key' => 'modified_user_id',
190    'relationship_type'=>'one-to-many')
191    ,strtolower($module).'_created_by' =>
192    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
193    'rhs_module'=> $module, 'rhs_table'=> strtolower($module), 'rhs_key' => 'created_by',
194    'relationship_type'=>'one-to-many')
195 ),
196
197
198 );
199 ?>