]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Cases/vardefs.php
Release 6.1.4
[Github/sugarcrm.git] / modules / Cases / vardefs.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM 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,'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   'calls' =>
153   array (
154         'name' => 'calls',
155     'type' => 'link',
156     'relationship' => 'case_calls',
157     'source'=>'non-db',
158                 'vname'=>'LBL_CALLS',
159   ),
160   'bugs' =>
161   array (
162         'name' => 'bugs',
163     'type' => 'link',
164     'relationship' => 'cases_bugs',
165     'source'=>'non-db',
166                 'vname'=>'LBL_BUGS',
167   ),
168   'contacts' =>
169   array (
170         'name' => 'contacts',
171     'type' => 'link',
172     'relationship' => 'contacts_cases',
173     'source'=>'non-db',
174                 'vname'=>'LBL_CONTACTS',
175   ),
176   'accounts' =>
177   array (
178         'name' => 'accounts',
179     'type' => 'link',
180     'relationship' => 'account_cases',
181                 'link_type'=>'one',
182                 'side'=>'right',
183     'source'=>'non-db',
184                 'vname'=>'LBL_ACCOUNT',
185   ),
186         'project' =>
187         array (
188             'name' => 'project',
189             'type' => 'link',
190             'relationship' => 'projects_cases',
191             'source'=>'non-db',
192             'vname'=>'LBL_PROJECTS',
193         ),
194
195   ), 'indices' => array (
196        array('name' =>'case_number' , 'type'=>'index' , 'fields'=>array('case_number')),
197
198        array('name' =>'idx_case_name', 'type' =>'index', 'fields'=>array('name')),
199        array( 'name' => 'idx_account_id', 'type' => 'index', 'fields'=> array('account_id')),
200        array('name' => 'idx_cases_stat_del', 'type' => 'index', 'fields'=> array('assigned_user_id', 'status', 'deleted')),
201                                                       )
202
203 , 'relationships' => array (
204         'case_calls' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
205                                                           'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
206                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
207                                                           'relationship_role_column_value'=>'Cases')
208
209         ,'case_tasks' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
210                                                           'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
211                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
212                                                           'relationship_role_column_value'=>'Cases')
213
214         ,'case_notes' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
215                                                           'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
216                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
217                                                           'relationship_role_column_value'=>'Cases')
218
219         ,'case_meetings' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
220                                                           'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'parent_id',
221                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
222                                                           'relationship_role_column_value'=>'Cases')
223
224         ,'case_emails' => array('lhs_module'=> 'Cases', 'lhs_table'=> 'cases', 'lhs_key' => 'id',
225                                                           'rhs_module'=> 'Emails', 'rhs_table'=> 'emails', 'rhs_key' => 'parent_id',
226                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
227                                                           'relationship_role_column_value'=>'Cases')
228     ,
229    'cases_assigned_user' =>
230    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
231    'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'assigned_user_id',
232    'relationship_type'=>'one-to-many')
233
234    ,'cases_modified_user' =>
235    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
236    'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'modified_user_id',
237    'relationship_type'=>'one-to-many')
238
239    ,'cases_created_by' =>
240    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
241    'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'created_by',
242    'relationship_type'=>'one-to-many')
243 )
244 //This enables optimistic locking for Saves From EditView
245         ,'optimistic_locking'=>true,
246 );
247 VardefManager::createVardef('Cases','Case', array('default', 'assignable',
248 'issue',
249 ),
250 'case'
251 );
252
253 //jc - adding for refactor for import to not use the required_fields array
254 //defined in the field_arrays.php file
255 $dictionary['Case']['fields']['name']['importable'] = 'required';
256 ?>