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 ********************************************************************************/
38 $dictionary['Call'] = array('table' => 'calls', 'comment' => 'A Call is an activity representing a phone call',
39 'unified_search' => true, 'unified_search_default_enabled' => true, 'fields' => array (
44 'vname' => 'LBL_SUBJECT',
45 'dbType' => 'varchar',
48 'comment' => 'Brief description of the call',
49 'unified_search' => true,
51 'importable' => 'required',
56 'name' => 'duration_hours',
57 'vname' => 'LBL_DURATION_HOURS',
60 'comment' => 'Call duration, hours portion',
65 'name' => 'duration_minutes',
66 'vname' => 'LBL_DURATION_MINUTES',
68 'function' => array('name'=>'getDurationMinutesOptions', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php'),
70 'group'=>'duration_hours',
71 'importable' => 'required',
72 'comment' => 'Call duration, minutes portion'
77 'name' => 'date_start',
78 'vname' => 'LBL_DATE',
79 'type' => 'datetimecombo',
80 'dbType' => 'datetime',
81 'comment' => 'Date in which call is schedule to (or did) start',
82 'importable' => 'required',
84 'enable_range_search' => true,
85 'options' => 'date_range_search_dom',
91 'vname' => 'LBL_DATE_END',
94 'comment' => 'Date is which call is scheduled to (or did) end',
95 'enable_range_search' => true,
96 'options' => 'date_range_search_dom',
101 'name'=>'parent_type',
102 'vname'=>'LBL_PARENT_TYPE',
103 'type' => 'parent_type',
106 'group'=>'parent_name',
107 'options'=> 'parent_type_display',
109 'comment' => 'The Sugar object to which the call is related'
114 'name'=> 'parent_name',
115 'parent_type'=>'record_type_display' ,
116 'type_name'=>'parent_type',
117 'id_name'=>'parent_id',
118 'vname'=>'LBL_LIST_RELATED_TO',
120 'group'=>'parent_name',
122 'options'=> 'parent_type_display',
127 'vname' => 'LBL_STATUS',
130 'options' => 'call_status_dom',
131 'comment' => 'The status of the call (Held, Not Held, etc.)',
133 'importable' => 'required',
134 'default' => 'Planned',
138 'name' => 'direction',
139 'vname' => 'LBL_DIRECTION',
142 'options' => 'call_direction_dom',
143 'comment' => 'Indicates whether call is inbound or outbound'
148 'vname'=>'LBL_LIST_RELATED_TO_ID',
150 'group'=>'parent_name',
152 'comment' => 'The ID of the parent Sugar object identified by parent_type'
154 'reminder_checked'=>array(
155 'name' => 'reminder_checked',
156 'vname' => 'LBL_REMINDER',
158 'source' => 'non-db',
159 'comment' => 'checkbox indicating whether or not the reminder value is set (Meta-data only)',
163 'reminder_time'=>array (
164 'name' => 'reminder_time',
165 'vname' => 'LBL_REMINDER_TIME',
167 'function' => array('name'=>'getReminderTime', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php', 'onListView'=>true),
169 'reportable' => false,
172 'comment' => 'Specifies when a reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
177 'name' => 'outlook_id',
178 'vname' => 'LBL_OUTLOOK_ID',
181 'reportable' => false,
182 'comment' => 'When the Sugar Plug-in for Microsoft Outlook syncs an Outlook appointment, this is the Outlook appointment item ID'
184 'accept_status' => array (
185 'name' => 'accept_status',
186 'vname' => 'LBL_SUBJECT',
187 'dbType' => 'varchar',
193 'set_accept_links' => array (
194 'name' => 'accept_status',
195 'vname' => 'LBL_SUBJECT',
196 'dbType' => 'varchar',
203 'name' => 'contact_name',
204 'rname' => 'last_name',
205 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
206 'id_name' => 'contact_id',
207 'massupdate' => false,
208 'vname' => 'LBL_CONTACT_NAME',
211 'table' => 'contacts',
213 'module' => 'Contacts',
214 'join_name' => 'contacts',
215 'dbType' => 'varchar',
218 'importable' => 'false',
219 'studio' => array('required' => false, 'listview'=>true, 'visible' => false),
225 'relationship' => 'account_calls',
228 'vname'=>'LBL_OLD_ACCOUNT_LINK',
232 'name' => 'opportunity',
234 'relationship' => 'opportunity_calls',
237 'vname'=>'LBL_OPPORTUNITY',
243 'relationship' => 'calls_leads',
245 'vname'=>'LBL_LEADS',
251 'relationship' => 'case_calls',
258 'name' => 'accounts',
260 'relationship' => 'account_calls',
261 'module'=>'Accounts',
262 'bean_name'=>'Account',
264 'vname'=>'LBL_ACCOUNT',
268 'name' => 'contacts',
270 'relationship' => 'calls_contacts',
272 'vname'=>'LBL_CONTACTS',
278 'relationship' => 'calls_users',
280 'vname'=>'LBL_USERS',
286 'relationship' => 'calls_notes',
290 'vname'=>'LBL_NOTES',
294 'name' => 'created_by_link',
296 'relationship' => 'calls_created_by',
297 'vname' => 'LBL_CREATED_BY_USER',
298 'link_type' => 'one',
303 'modified_user_link' =>
305 'name' => 'modified_user_link',
307 'relationship' => 'calls_modified_user',
308 'vname' => 'LBL_MODIFIED_BY_USER',
309 'link_type' => 'one',
314 'assigned_user_link' =>
316 'name' => 'assigned_user_link',
318 'relationship' => 'calls_assigned_user',
319 'vname' => 'LBL_ASSIGNED_TO_USER',
320 'link_type' => 'one',
325 'contact_id' => array(
326 'name' => 'contact_id',
328 'source' => 'non-db',
329 'importable' => false,
334 'name' => 'idx_call_name',
336 'fields'=> array('name'),
339 'name' => 'idx_status',
341 'fields'=> array('status'),
344 'name' => 'idx_calls_date_start',
346 'fields' => array('date_start'),
349 'name' => 'idx_calls_par_del',
351 'fields' => array('parent_id','parent_type','deleted')
354 'relationships' => array (
355 'calls_assigned_user' => array(
356 'lhs_module' => 'Users',
357 'lhs_table' => 'users',
359 'rhs_module' => 'Calls',
360 'rhs_table' => 'calls',
361 'rhs_key' => 'assigned_user_id',
362 'relationship_type' => 'one-to-many'
364 'calls_modified_user' => array(
365 'lhs_module' => 'Users',
366 'lhs_table' => 'users',
368 'rhs_module' => 'Calls',
369 'rhs_table' => 'calls',
370 'rhs_key' => 'modified_user_id',
371 'relationship_type' => 'one-to-many'
373 'calls_created_by' => array(
374 'lhs_module' => 'Users',
375 'lhs_table' => 'users',
377 'rhs_module' => 'Calls',
378 'rhs_table' => 'calls',
379 'rhs_key' => 'created_by',
380 'relationship_type' => 'one-to-many'
382 'calls_notes' => array(
383 'lhs_module' => 'Calls',
384 'lhs_table' => 'calls',
386 'rhs_module' => 'Notes',
387 'rhs_table' => 'notes',
388 'rhs_key' => 'parent_id',
389 'relationship_type' => 'one-to-many',
392 //This enables optimistic locking for Saves From EditView
393 'optimistic_locking' => true,
396 VardefManager::createVardef('Calls','Call', array('default', 'assignable',