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