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.
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.
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
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
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.
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.
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 ********************************************************************************/
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'
46 'name' => 'account_name',
48 'id_name' => 'account_id',
49 'vname' => 'LBL_ACCOUNT_NAME',
52 'table' => 'accounts',
53 'join_name'=>'accounts',
55 'module' => 'Accounts',
56 'dbType' => 'varchar',
59 'unified_search' => true,
60 'comment' => 'The name of the account represented by the account_id field',
62 'importable' => 'required',
66 'name' => 'account_name1',
70 'importable' => 'false',
79 'module' => 'Accounts',
80 'id_name' => 'account_id',
82 'vname'=>'LBL_ACCOUNT_ID',
84 'massupdate' => false,
85 'comment' => 'The account to which the case is associated'
91 'vname' => 'LBL_STATUS',
93 'options' => 'case_status_dom',
96 'comment' => 'The status of the case',
101 'name' => 'priority',
102 'vname' => 'LBL_PRIORITY',
104 'options' => 'case_priority_dom',
107 'comment' => 'The priority of the case',
112 'name' => 'resolution',
113 'vname' => 'LBL_RESOLUTION',
115 'comment' => 'The resolution of the case'
123 'relationship' => 'case_tasks',
125 'vname'=>'LBL_TASKS',
131 'relationship' => 'case_notes',
133 'vname'=>'LBL_NOTES',
137 'name' => 'meetings',
139 'relationship' => 'case_meetings',
140 'bean_name'=>'Meeting',
142 'vname'=>'LBL_MEETINGS',
148 'relationship' => 'emails_cases_rel',/* reldef in emails */
150 'vname'=>'LBL_EMAILS',
156 'relationship' => 'case_calls',
158 'vname'=>'LBL_CALLS',
164 'relationship' => 'cases_bugs',
170 'name' => 'contacts',
172 'relationship' => 'contacts_cases',
174 'vname'=>'LBL_CONTACTS',
178 'name' => 'accounts',
180 'relationship' => 'account_cases',
184 'vname'=>'LBL_ACCOUNT',
190 'relationship' => 'projects_cases',
192 'vname'=>'LBL_PROJECTS',
195 ), 'indices' => array (
196 array('name' =>'case_number' , 'type'=>'index' , 'fields'=>array('case_number')),
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')),
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')
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')
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')
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')
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')
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')
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')
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')
244 //This enables optimistic locking for Saves From EditView
245 ,'optimistic_locking'=>true,
247 VardefManager::createVardef('Cases','Case', array('default', 'assignable',
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';