]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Bugs/vardefs.php
Release 6.5.0
[Github/sugarcrm.git] / modules / Bugs / vardefs.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38 $dictionary['Bug'] = array('table' => 'bugs',    'audited'=>true, 'comment' => 'Bugs are defects in products and services','duplicate_merge'=>true
39                                ,'unified_search' => true,'fields' => array (
40   'found_in_release'=>
41         array(
42         'name'=>'found_in_release',
43         'type' => 'enum',
44         'function'=>'getReleaseDropDown',
45         'vname' => 'LBL_FOUND_IN_RELEASE',
46         'reportable'=>false,
47         //'merge_filter' => 'enabled', //bug 22994, I think the former fixing is just avoiding the cross table query, it is not a good method.
48     'comment' => 'The software or service release that manifested the bug',
49     'duplicate_merge' => 'disabled',
50     'audited' =>true,
51         'studio' => array('fields' => 'false', 'listview' => false, 'wirelesslistview' => false ), // tyoung bug 16442 - don't show in studio fields list
52     'massupdate' => true,
53         ),
54 'release_name'=>
55   array (
56     'name' => 'release_name',
57     'rname' => 'name',
58     'vname'=>'LBL_FOUND_IN_RELEASE',
59     'type' => 'relate',
60     'dbType'=>'varchar',
61         'group'=>'found_in_release',
62     'reportable'=>false,
63     'source'=>'non-db',
64     'table'=>'releases',
65     'merge_filter' => 'enabled', //bug 22994, we should use the release name to search, I have write codes to operate the cross table query. 
66     'id_name'=>'found_in_release',
67     'module'=>'Releases',
68     'link' => 'release_link',
69     'massupdate' => false,
70         'studio' => array(
71        'editview' => false, 
72        'detailview' => false,
73        'quickcreate' => false, 
74        'basic_search' => false, 
75        'advanced_search' => false,
76            //BEGIN SUGARCRM flav=pro
77            'wirelesseditview' => false,
78            'wirelessdetailview' => false,
79            'wirelesslistview' => 'visible',
80            'wireless_basic_search' => false,
81            'wireless_advanced_search' => false,
82            //END SUGARCRM flav=pro
83            ),
84   ),
85
86     'fixed_in_release'=>
87         array(
88         'name'=>'fixed_in_release',
89         'type' => 'enum',
90         'function'=>'getReleaseDropDown',
91         'vname' => 'LBL_FIXED_IN_RELEASE',
92         'reportable'=>false,
93     'comment' => 'The software or service release that corrected the bug',
94     'duplicate_merge' => 'disabled',
95     'audited' =>true,
96         'studio' => array('fields' => 'false', 'listview' => false, 'wirelesslistview' => false), // tyoung bug 16442 - don't show in studio fields list
97         'massupdate' => true,
98         ),
99    'fixed_in_release_name'=>
100   array (
101     'name' => 'fixed_in_release_name',
102     'rname' => 'name',
103     'group'=>'fixed_in_release',
104     'id_name' => 'fixed_in_release',
105     'vname' => 'LBL_FIXED_IN_RELEASE',
106     'type' => 'relate',
107     'table' => 'releases',
108     'isnull' => 'false',
109     'massupdate' => false,
110     'module' => 'Releases',
111     'dbType' => 'varchar',
112     'len' => 36,
113     'source'=>'non-db',
114     'link' => 'fixed_in_release_link',
115         'studio' => array(
116        'editview' => false, 
117        'detailview' => false,
118        'quickcreate' => false, 
119        'basic_search' => false, 
120        'advanced_search' => false,
121        //BEGIN SUGARCRM flav=pro
122        'wirelesseditview' => false,
123        'wirelessdetailview' => false,
124        'wirelesslistview' => 'visible',
125        'wireless_basic_search' => false,
126        'wireless_advanced_search' => false,
127        //END SUGARCRM flav=pro
128        ),
129   ),
130     'source' =>
131   array (
132     'name' => 'source',
133     'vname' => 'LBL_SOURCE',
134     'type' => 'enum',
135     'options'=>'source_dom',
136     'len' => 255,
137     'comment' => 'An indicator of how the bug was entered (ex: via web, email, etc.)'
138   ),
139     'product_category' =>
140   array (
141     'name' => 'product_category',
142     'vname' => 'LBL_PRODUCT_CATEGORY',
143     'type' => 'enum',
144     'options'=>'product_category_dom',
145     'len' => 255,
146     'comment' => 'Where the bug was discovered (ex: Accounts, Contacts, Leads)'
147   ),
148
149
150   'tasks' =>
151   array (
152         'name' => 'tasks',
153     'type' => 'link',
154     'relationship' => 'bug_tasks',
155     'source'=>'non-db',
156                 'vname'=>'LBL_TASKS'
157   ),
158   'notes' =>
159   array (
160         'name' => 'notes',
161     'type' => 'link',
162     'relationship' => 'bug_notes',
163     'source'=>'non-db',
164                 'vname'=>'LBL_NOTES'
165   ),
166   'meetings' =>
167   array (
168         'name' => 'meetings',
169     'type' => 'link',
170     'relationship' => 'bug_meetings',
171     'source'=>'non-db',
172                 'vname'=>'LBL_MEETINGS'
173   ),
174   'calls' =>
175   array (
176         'name' => 'calls',
177     'type' => 'link',
178     'relationship' => 'bug_calls',
179     'source'=>'non-db',
180                 'vname'=>'LBL_CALLS'
181   ),
182   'emails' =>
183   array (
184         'name' => 'emails',
185     'type' => 'link',
186     'relationship' => 'emails_bugs_rel',/* reldef in emails */
187     'source'=>'non-db',
188                 'vname'=>'LBL_EMAILS'
189   ),
190   'documents'=>
191   array (
192       'name' => 'documents',
193       'type' => 'link',
194       'relationship' => 'documents_bugs',
195       'source' => 'non-db',
196       'vname' => 'LBL_DOCUMENTS_SUBPANEL_TITLE',
197   ),
198   'contacts' =>
199   array (
200         'name' => 'contacts',
201     'type' => 'link',
202     'relationship' => 'contacts_bugs',
203     'source'=>'non-db',
204                 'vname'=>'LBL_CONTACTS'
205   ),
206   'accounts' =>
207   array (
208         'name' => 'accounts',
209     'type' => 'link',
210     'relationship' => 'accounts_bugs',
211     'source'=>'non-db',
212                 'vname'=>'LBL_ACCOUNTS'
213   ),
214   'cases' =>
215   array (
216         'name' => 'cases',
217     'type' => 'link',
218     'relationship' => 'cases_bugs',
219     'source'=>'non-db',
220                 'vname'=>'LBL_CASES'
221   ),
222   'project' =>
223   array (
224         'name' => 'project',
225         'type' => 'link',
226         'relationship' => 'projects_bugs',
227         'source'=>'non-db',
228         'vname'=>'LBL_PROJECTS',
229   ),
230   'release_link' =>
231   array (
232         'name' => 'release_link',
233     'type' => 'link',
234     'relationship' => 'bugs_release',
235     'vname' => 'LBL_FOUND_IN_RELEASE',
236     'link_type' => 'one',
237     'module'=>'Releases',
238     'bean_name'=>'Release',
239     'source'=>'non-db',
240   ),
241   'fixed_in_release_link' =>
242   array (
243         'name' => 'fixed_in_release_link',
244     'type' => 'link',
245     'relationship' => 'bugs_fixed_in_release',
246     'vname' => 'LBL_FIXED_IN_RELEASE',
247     'link_type' => 'one',
248     'module'=>'Releases',
249     'bean_name'=>'Release',
250     'source'=>'non-db',
251   ),
252
253 )
254                                                       , 'indices' => array (
255       array('name' =>'bug_number', 'type' =>'index', 'fields'=>array('bug_number')),
256
257        array('name' =>'idx_bug_name', 'type' =>'index', 'fields'=>array('name')),
258
259        array('name' => 'idx_bugs_assigned_user', 'type' => 'index', 'fields'=> array('assigned_user_id')),
260
261                                                       )
262
263 , 'relationships' => array (
264         'bug_tasks' => array('lhs_module'=> 'Bugs', 'lhs_table'=> 'bugs', 'lhs_key' => 'id',
265                                                           'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
266                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
267                                                           'relationship_role_column_value'=>'Bugs')
268         ,'bug_meetings' => array('lhs_module'=> 'Bugs', 'lhs_table'=> 'bugs', 'lhs_key' => 'id',
269                                                           'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'parent_id',
270                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
271                                                           'relationship_role_column_value'=>'Bugs')
272         ,'bug_calls' => array('lhs_module'=> 'Bugs', 'lhs_table'=> 'bugs', 'lhs_key' => 'id',
273                                                           'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
274                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
275                                                           'relationship_role_column_value'=>'Bugs')
276         ,'bug_emails' => array('lhs_module'=> 'Bugs', 'lhs_table'=> 'bugs', 'lhs_key' => 'id',
277                                                           'rhs_module'=> 'Emails', 'rhs_table'=> 'emails', 'rhs_key' => 'parent_id',
278                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
279                                                           'relationship_role_column_value'=>'Bugs')
280         ,'bug_notes' => array('lhs_module'=> 'Bugs', 'lhs_table'=> 'bugs', 'lhs_key' => 'id',
281                                                           'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
282                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
283                                                           'relationship_role_column_value'=>'Bugs')
284
285   ,'bugs_assigned_user' =>
286    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
287    'rhs_module'=> 'Bugs', 'rhs_table'=> 'bugs', 'rhs_key' => 'assigned_user_id',
288    'relationship_type'=>'one-to-many')
289
290    ,'bugs_modified_user' =>
291    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
292    'rhs_module'=> 'Bugs', 'rhs_table'=> 'bugs', 'rhs_key' => 'modified_user_id',
293    'relationship_type'=>'one-to-many')
294
295    ,'bugs_created_by' =>
296    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
297    'rhs_module'=> 'Bugs', 'rhs_table'=> 'bugs', 'rhs_key' => 'created_by',
298    'relationship_type'=>'one-to-many')
299    ,'bugs_release' =>
300    array('lhs_module'=> 'Releases', 'lhs_table'=> 'releases', 'lhs_key' => 'id',
301    'rhs_module'=> 'Bugs', 'rhs_table'=> 'bugs', 'rhs_key' => 'found_in_release',
302    'relationship_type'=>'one-to-many')
303    ,'bugs_fixed_in_release' =>
304    array('lhs_module'=> 'Releases', 'lhs_table'=> 'releases', 'lhs_key' => 'id',
305    'rhs_module'=> 'Bugs', 'rhs_table'=> 'bugs', 'rhs_key' => 'fixed_in_release',
306    'relationship_type'=>'one-to-many')
307
308 ),         //This enables optimistic locking for Saves From EditView
309         'optimistic_locking'=>true,
310                             );
311
312 VardefManager::createVardef('Bugs','Bug', array('default', 'assignable',
313 'issue',
314 ));
315
316 //jc - adding for refactor for import to not use the required_fields array
317 //defined in the field_arrays.php file
318 $dictionary['Bug']['fields']['name']['importable'] = 'required';
319
320 ?>