]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Cases/vardefs.php
Release 6.2.0
[Github/sugarcrm.git] / modules / Cases / 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-2011 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
39 $dictionary['Case'] = array('table' => 'cases','audited'=>true, 'unified_search' => true, 'unified_search_default_enabled' => true, 'duplicate_merge'=>true,
40                 'comment' => 'Cases are issues or problems that a customer asks a support representative to resolve'
41                                ,'fields' => array (
42
43
44    'account_name' =>
45   array (
46     'name' => 'account_name',
47     'rname' => 'name',
48     'id_name' => 'account_id',
49     'vname' => 'LBL_ACCOUNT_NAME',
50     'type' => 'relate',
51     'link'=>'accounts',
52     'table' => 'accounts',
53     'join_name'=>'accounts',
54     'isnull' => 'true',
55     'module' => 'Accounts',
56     'dbType' => 'varchar',
57     'len' => 100,
58     'source'=>'non-db',
59     'unified_search' => true,
60     'comment' => 'The name of the account represented by the account_id field',
61     'required' => true,
62     'importable' => 'required',
63   ),
64    'account_name1' =>
65   array (
66     'name' => 'account_name1',
67     'source'=>'non-db',
68     'type'=>'text',
69     'len' => 100,
70     'importable' => 'false',
71   ),
72
73     'account_id'=>
74         array(
75         'name'=>'account_id',
76         'type' => 'relate',
77         'dbType' => 'id',
78         'rname' => 'id',
79     'module' => 'Accounts',
80     'id_name' => 'account_id',
81     'reportable'=>false,
82         'vname'=>'LBL_ACCOUNT_ID',
83         'audited'=>true,
84         'massupdate' => false,
85         'comment' => 'The account to which the case is associated'
86         ),
87
88   'status' =>
89   array (
90     'name' => 'status',
91     'vname' => 'LBL_STATUS',
92     'type' => 'enum',
93     'options' => 'case_status_dom',
94     'len' => 100,
95     'audited'=>true,
96     'comment' => 'The status of the case',
97
98   ),
99    'priority' =>
100   array (
101     'name' => 'priority',
102     'vname' => 'LBL_PRIORITY',
103     'type' => 'enum',
104     'options' => 'case_priority_dom',
105     'len' => 100,
106     'audited'=>true,
107     'comment' => 'The priority of the case',
108
109   ),
110   'resolution' =>
111   array (
112     'name' => 'resolution',
113     'vname' => 'LBL_RESOLUTION',
114     'type' => 'text',
115     'comment' => 'The resolution of the case'
116   ),
117
118
119   'tasks' =>
120   array (
121         'name' => 'tasks',
122     'type' => 'link',
123     'relationship' => 'case_tasks',
124     'source'=>'non-db',
125                 'vname'=>'LBL_TASKS',
126   ),
127   'notes' =>
128   array (
129         'name' => 'notes',
130     'type' => 'link',
131     'relationship' => 'case_notes',
132     'source'=>'non-db',
133                 'vname'=>'LBL_NOTES',
134   ),
135   'meetings' =>
136   array (
137         'name' => 'meetings',
138     'type' => 'link',
139     'relationship' => 'case_meetings',
140     'bean_name'=>'Meeting',
141     'source'=>'non-db',
142                 'vname'=>'LBL_MEETINGS',
143   ),
144   'emails' =>
145   array (
146         'name' => 'emails',
147     'type' => 'link',
148     'relationship' => 'emails_cases_rel',/* reldef in emails */
149     'source'=>'non-db',
150                 'vname'=>'LBL_EMAILS',
151   ),
152   'documents'=>
153   array (
154       'name' => 'documents',
155       'type' => 'link',
156       'relationship' => 'documents_cases',
157       'source' => 'non-db',
158       'vname' => 'LBL_DOCUMENTS_SUBPANEL_TITLE',
159   ),
160   'calls' =>
161   array (
162         'name' => 'calls',
163     'type' => 'link',
164     'relationship' => 'case_calls',
165     'source'=>'non-db',
166                 'vname'=>'LBL_CALLS',
167   ),
168   'bugs' =>
169   array (
170         'name' => 'bugs',
171     'type' => 'link',
172     'relationship' => 'cases_bugs',
173     'source'=>'non-db',
174                 'vname'=>'LBL_BUGS',
175   ),
176   'contacts' =>
177   array (
178         'name' => 'contacts',
179     'type' => 'link',
180     'relationship' => 'contacts_cases',
181     'source'=>'non-db',
182                 'vname'=>'LBL_CONTACTS',
183   ),
184   'accounts' =>
185   array (
186         'name' => 'accounts',
187     'type' => 'link',
188     'relationship' => 'account_cases',
189                 'link_type'=>'one',
190                 'side'=>'right',
191     'source'=>'non-db',
192                 'vname'=>'LBL_ACCOUNT',
193   ),
194         'project' =>
195         array (
196             'name' => 'project',
197             'type' => 'link',
198             'relationship' => 'projects_cases',
199             'source'=>'non-db',
200             'vname'=>'LBL_PROJECTS',
201         ),
202
203   ), 'indices' => array (
204        array('name' =>'case_number' , 'type'=>'index' , 'fields'=>array('case_number')),
205
206        array('name' =>'idx_case_name', 'type' =>'index', 'fields'=>array('name')),
207        array( 'name' => 'idx_account_id', 'type' => 'index', 'fields'=> array('account_id')),
208        array('name' => 'idx_cases_stat_del', 'type' => 'index', 'fields'=> array('assigned_user_id', 'status', 'deleted')),
209                                                       )
210
211 , 'relationships' => array (
212         'case_calls' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
213                                                           'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
214                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
215                                                           'relationship_role_column_value'=>'Cases')
216
217         ,'case_tasks' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
218                                                           'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
219                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
220                                                           'relationship_role_column_value'=>'Cases')
221
222         ,'case_notes' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
223                                                           'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
224                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
225                                                           'relationship_role_column_value'=>'Cases')
226
227         ,'case_meetings' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
228                                                           'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'parent_id',
229                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
230                                                           'relationship_role_column_value'=>'Cases')
231
232         ,'case_emails' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
233                                                           'rhs_module'=> 'Emails', 'rhs_table'=> 'emails', 'rhs_key' => 'parent_id',
234                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
235                                                           'relationship_role_column_value'=>'Cases')
236     ,
237    'cases_assigned_user' =>
238    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
239    'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'assigned_user_id',
240    'relationship_type'=>'one-to-many')
241
242    ,'cases_modified_user' =>
243    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
244    'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'modified_user_id',
245    'relationship_type'=>'one-to-many')
246
247    ,'cases_created_by' =>
248    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
249    'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'created_by',
250    'relationship_type'=>'one-to-many')
251 )
252 //This enables optimistic locking for Saves From EditView
253         ,'optimistic_locking'=>true,
254 );
255 VardefManager::createVardef('Cases','Case', array('default', 'assignable',
256 'issue',
257 ),
258 'case'
259 );
260
261 //jc - adding for refactor for import to not use the required_fields array
262 //defined in the field_arrays.php file
263 $dictionary['Case']['fields']['name']['importable'] = 'required';
264 ?>