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.
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, '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'
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',
71 'studio' => array("formula" => false),
80 'module' => 'Accounts',
81 'id_name' => 'account_id',
83 'vname'=>'LBL_ACCOUNT_ID',
85 'massupdate' => false,
86 'comment' => 'The account to which the case is associated'
92 'vname' => 'LBL_STATUS',
94 'options' => 'case_status_dom',
97 'comment' => 'The status of the case',
102 'name' => 'priority',
103 'vname' => 'LBL_PRIORITY',
105 'options' => 'case_priority_dom',
108 'comment' => 'The priority of the case',
113 'name' => 'resolution',
114 'vname' => 'LBL_RESOLUTION',
116 'comment' => 'The resolution of the case'
124 'relationship' => 'case_tasks',
126 'vname'=>'LBL_TASKS',
132 'relationship' => 'case_notes',
134 'vname'=>'LBL_NOTES',
138 'name' => 'meetings',
140 'relationship' => 'case_meetings',
141 'bean_name'=>'Meeting',
143 'vname'=>'LBL_MEETINGS',
149 'relationship' => 'emails_cases_rel',/* reldef in emails */
151 'vname'=>'LBL_EMAILS',
155 'name' => 'documents',
157 'relationship' => 'documents_cases',
158 'source' => 'non-db',
159 'vname' => 'LBL_DOCUMENTS_SUBPANEL_TITLE',
165 'relationship' => 'case_calls',
167 'vname'=>'LBL_CALLS',
173 'relationship' => 'cases_bugs',
179 'name' => 'contacts',
181 'relationship' => 'contacts_cases',
183 'vname'=>'LBL_CONTACTS',
187 'name' => 'accounts',
189 'relationship' => 'account_cases',
193 'vname'=>'LBL_ACCOUNT',
199 'relationship' => 'projects_cases',
201 'vname'=>'LBL_PROJECTS',
204 ), 'indices' => array (
205 array('name' =>'case_number' , 'type'=>'index' , 'fields'=>array('case_number')),
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')),
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')
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')
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')
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')
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')
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')
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')
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')
253 //This enables optimistic locking for Saves From EditView
254 ,'optimistic_locking'=>true,
256 VardefManager::createVardef('Cases','Case', array('default', 'assignable',
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';