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',
92 'type' => 'datetimecombo',
93 'dbType' => 'datetime',
95 'comment' => 'Date is which call is scheduled to (or did) end',
96 'enable_range_search' => true,
97 'options' => 'date_range_search_dom',
102 'name'=>'parent_type',
103 'vname'=>'LBL_PARENT_TYPE',
104 'type' => 'parent_type',
107 'group'=>'parent_name',
108 'options'=> 'parent_type_display',
110 'comment' => 'The Sugar object to which the call is related'
115 'name'=> 'parent_name',
116 'parent_type'=>'record_type_display' ,
117 'type_name'=>'parent_type',
118 'id_name'=>'parent_id',
119 'vname'=>'LBL_LIST_RELATED_TO',
121 'group'=>'parent_name',
123 'options'=> 'parent_type_display',
128 'vname' => 'LBL_STATUS',
131 'options' => 'call_status_dom',
132 'comment' => 'The status of the call (Held, Not Held, etc.)',
134 'importable' => 'required',
135 'default' => 'Planned',
136 'studio' => array('detailview'=>false)
140 'name' => 'direction',
141 'vname' => 'LBL_DIRECTION',
144 'options' => 'call_direction_dom',
145 'comment' => 'Indicates whether call is inbound or outbound'
150 'vname'=>'LBL_LIST_RELATED_TO_ID',
152 'group'=>'parent_name',
154 'comment' => 'The ID of the parent Sugar object identified by parent_type'
156 'reminder_checked'=>array(
157 'name' => 'reminder_checked',
158 'vname' => 'LBL_REMINDER',
160 'source' => 'non-db',
161 'comment' => 'checkbox indicating whether or not the reminder value is set (Meta-data only)',
165 'reminder_time'=>array (
166 'name' => 'reminder_time',
167 'vname' => 'LBL_REMINDER_TIME',
169 'function' => array('name'=>'getReminderTime', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php', 'onListView'=>true),
171 'reportable' => false,
174 'comment' => 'Specifies when a reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
179 'name' => 'outlook_id',
180 'vname' => 'LBL_OUTLOOK_ID',
183 'reportable' => false,
184 'comment' => 'When the Sugar Plug-in for Microsoft Outlook syncs an Outlook appointment, this is the Outlook appointment item ID'
186 'accept_status' => array (
187 'name' => 'accept_status',
188 'vname' => 'LBL_SUBJECT',
189 'dbType' => 'varchar',
195 'set_accept_links' => array (
196 'name' => 'accept_status',
197 'vname' => 'LBL_SUBJECT',
198 'dbType' => 'varchar',
205 'name' => 'contact_name',
206 'rname' => 'last_name',
207 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
208 'id_name' => 'contact_id',
209 'massupdate' => false,
210 'vname' => 'LBL_CONTACT_NAME',
213 'table' => 'contacts',
215 'module' => 'Contacts',
216 'join_name' => 'contacts',
217 'dbType' => 'varchar',
220 'importable' => 'false',
221 'studio' => array('required' => false, 'listview'=>true, 'visible' => false),
225 'name' => 'opportunity',
227 'relationship' => 'opportunity_calls',
230 'vname'=>'LBL_OPPORTUNITY',
236 'relationship' => 'calls_leads',
238 'vname'=>'LBL_LEADS',
244 'relationship' => 'case_calls',
251 'name' => 'accounts',
253 'relationship' => 'account_calls',
254 'module'=>'Accounts',
255 'bean_name'=>'Account',
257 'vname'=>'LBL_ACCOUNT',
261 'name' => 'contacts',
263 'relationship' => 'calls_contacts',
265 'vname'=>'LBL_CONTACTS',
271 'relationship' => 'calls_users',
273 'vname'=>'LBL_USERS',
279 'relationship' => 'calls_notes',
283 'vname'=>'LBL_NOTES',
287 'name' => 'created_by_link',
289 'relationship' => 'calls_created_by',
290 'vname' => 'LBL_CREATED_BY_USER',
291 'link_type' => 'one',
296 'modified_user_link' =>
298 'name' => 'modified_user_link',
300 'relationship' => 'calls_modified_user',
301 'vname' => 'LBL_MODIFIED_BY_USER',
302 'link_type' => 'one',
307 'assigned_user_link' =>
309 'name' => 'assigned_user_link',
311 'relationship' => 'calls_assigned_user',
312 'vname' => 'LBL_ASSIGNED_TO_USER',
313 'link_type' => 'one',
318 'contact_id' => array(
319 'name' => 'contact_id',
321 'source' => 'non-db',
322 'importable' => false,
327 'name' => 'idx_call_name',
329 'fields'=> array('name'),
332 'name' => 'idx_status',
334 'fields'=> array('status'),
337 'name' => 'idx_calls_date_start',
339 'fields' => array('date_start'),
342 'name' => 'idx_calls_par_del',
344 'fields' => array('parent_id','parent_type','deleted')
347 'name' =>'idx_calls_assigned_del',
349 'fields'=>array( 'deleted', 'assigned_user_id')),
351 'relationships' => array (
352 'calls_assigned_user' => array(
353 'lhs_module' => 'Users',
354 'lhs_table' => 'users',
356 'rhs_module' => 'Calls',
357 'rhs_table' => 'calls',
358 'rhs_key' => 'assigned_user_id',
359 'relationship_type' => 'one-to-many'
361 'calls_modified_user' => array(
362 'lhs_module' => 'Users',
363 'lhs_table' => 'users',
365 'rhs_module' => 'Calls',
366 'rhs_table' => 'calls',
367 'rhs_key' => 'modified_user_id',
368 'relationship_type' => 'one-to-many'
370 'calls_created_by' => array(
371 'lhs_module' => 'Users',
372 'lhs_table' => 'users',
374 'rhs_module' => 'Calls',
375 'rhs_table' => 'calls',
376 'rhs_key' => 'created_by',
377 'relationship_type' => 'one-to-many'
379 'calls_notes' => array(
380 'lhs_module' => 'Calls',
381 'lhs_table' => 'calls',
383 'rhs_module' => 'Notes',
384 'rhs_table' => 'notes',
385 'rhs_key' => 'parent_id',
386 'relationship_type' => 'one-to-many',
387 'relationship_role_column'=>'parent_type',
388 'relationship_role_column_value'=>'Calls',
391 //This enables optimistic locking for Saves From EditView
392 'optimistic_locking' => true,
395 VardefManager::createVardef('Calls','Call', array('default', 'assignable',