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.
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, 'unified_search_default_enabled' => 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',
154 'name' => 'documents',
156 'relationship' => 'documents_cases',
157 'source' => 'non-db',
158 'vname' => 'LBL_DOCUMENTS_SUBPANEL_TITLE',
164 'relationship' => 'case_calls',
166 'vname'=>'LBL_CALLS',
172 'relationship' => 'cases_bugs',
178 'name' => 'contacts',
180 'relationship' => 'contacts_cases',
182 'vname'=>'LBL_CONTACTS',
186 'name' => 'accounts',
188 'relationship' => 'account_cases',
192 'vname'=>'LBL_ACCOUNT',
198 'relationship' => 'projects_cases',
200 'vname'=>'LBL_PROJECTS',
203 ), 'indices' => array (
204 array('name' =>'case_number' , 'type'=>'index' , 'fields'=>array('case_number')),
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')),
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')
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')
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')
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')
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')
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')
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')
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')
252 //This enables optimistic locking for Saves From EditView
253 ,'optimistic_locking'=>true,
255 VardefManager::createVardef('Cases','Case', array('default', 'assignable',
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';