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