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 ********************************************************************************/
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',
194 'name' => 'contact_name',
195 'rname' => 'last_name',
196 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
197 'id_name' => 'contact_id',
198 'massupdate' => false,
199 'vname' => 'LBL_CONTACT_NAME',
202 'table' => 'contacts',
204 'module' => 'Contacts',
205 'join_name' => 'contacts',
206 'dbType' => 'varchar',
209 'importable' => 'false',
210 'studio' => array('required' => false, 'listview'=>true, 'visible' => false),
216 'relationship' => 'account_calls',
219 'vname'=>'LBL_OLD_ACCOUNT_LINK',
223 'name' => 'opportunity',
225 'relationship' => 'opportunity_calls',
228 'vname'=>'LBL_OPPORTUNITY',
234 'relationship' => 'calls_leads',
236 'vname'=>'LBL_LEADS',
242 'relationship' => 'case_calls',
249 'name' => 'accounts',
251 'relationship' => 'account_calls',
252 'module'=>'Accounts',
253 'bean_name'=>'Account',
255 'vname'=>'LBL_ACCOUNT',
259 'name' => 'contacts',
261 'relationship' => 'calls_contacts',
263 'vname'=>'LBL_CONTACTS',
269 'relationship' => 'calls_users',
271 'vname'=>'LBL_USERS',
277 'relationship' => 'calls_notes',
281 'vname'=>'LBL_NOTES',
285 'name' => 'created_by_link',
287 'relationship' => 'calls_created_by',
288 'vname' => 'LBL_CREATED_BY_USER',
289 'link_type' => 'one',
294 'modified_user_link' =>
296 'name' => 'modified_user_link',
298 'relationship' => 'calls_modified_user',
299 'vname' => 'LBL_MODIFIED_BY_USER',
300 'link_type' => 'one',
305 'assigned_user_link' =>
307 'name' => 'assigned_user_link',
309 'relationship' => 'calls_assigned_user',
310 'vname' => 'LBL_ASSIGNED_TO_USER',
311 'link_type' => 'one',
316 'contact_id' => array(
317 'name' => 'contact_id',
319 'source' => 'non-db',
320 'importable' => false,
325 'name' => 'idx_call_name',
327 'fields'=> array('name'),
330 'name' => 'idx_status',
332 'fields'=> array('status'),
335 'name' => 'idx_calls_date_start',
337 'fields' => array('date_start'),
340 'name' => 'idx_calls_par_del',
342 'fields' => array('parent_id','parent_type','deleted')
345 'relationships' => array (
346 'calls_assigned_user' => array(
347 'lhs_module' => 'Users',
348 'lhs_table' => 'users',
350 'rhs_module' => 'Calls',
351 'rhs_table' => 'calls',
352 'rhs_key' => 'assigned_user_id',
353 'relationship_type' => 'one-to-many'
355 'calls_modified_user' => array(
356 'lhs_module' => 'Users',
357 'lhs_table' => 'users',
359 'rhs_module' => 'Calls',
360 'rhs_table' => 'calls',
361 'rhs_key' => 'modified_user_id',
362 'relationship_type' => 'one-to-many'
364 'calls_created_by' => array(
365 'lhs_module' => 'Users',
366 'lhs_table' => 'users',
368 'rhs_module' => 'Calls',
369 'rhs_table' => 'calls',
370 'rhs_key' => 'created_by',
371 'relationship_type' => 'one-to-many'
373 'calls_notes' => array(
374 'lhs_module' => 'Calls',
375 'lhs_table' => 'calls',
377 'rhs_module' => 'Notes',
378 'rhs_table' => 'notes',
379 'rhs_key' => 'parent_id',
380 'relationship_type' => 'one-to-many',
383 //This enables optimistic locking for Saves From EditView
384 'optimistic_locking' => true,
387 VardefManager::createVardef('Calls','Call', array('default', 'assignable',