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,'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',
89 'vname' => 'LBL_DATE_END',
92 'comment' => 'Date is which call is scheduled to (or did) end'
97 'name'=>'parent_type',
98 'vname'=>'LBL_PARENT_TYPE',
99 'type' => 'parent_type',
102 'group'=>'parent_name',
103 'options'=> 'parent_type_display',
105 'comment' => 'The Sugar object to which the call is related'
110 'name'=> 'parent_name',
111 'parent_type'=>'record_type_display' ,
112 'type_name'=>'parent_type',
113 'id_name'=>'parent_id',
114 'vname'=>'LBL_LIST_RELATED_TO',
116 'group'=>'parent_name',
118 'options'=> 'parent_type_display',
123 'vname' => 'LBL_STATUS',
126 'options' => 'call_status_dom',
127 'comment' => 'The status of the call (Held, Not Held, etc.)',
129 'importable' => 'required',
133 'name' => 'direction',
134 'vname' => 'LBL_DIRECTION',
137 'options' => 'call_direction_dom',
138 'comment' => 'Indicates whether call is inbound or outbound'
143 'vname'=>'LBL_LIST_RELATED_TO_ID',
145 'group'=>'parent_name',
147 'comment' => 'The ID of the parent Sugar object identified by parent_type'
149 'reminder_checked'=>array(
150 'name' => 'reminder_checked',
151 'vname' => 'LBL_REMINDER',
153 'source' => 'non-db',
154 'comment' => 'checkbox indicating whether or not the reminder value is set (Meta-data only)',
158 'reminder_time'=>array (
159 'name' => 'reminder_time',
160 'vname' => 'LBL_REMINDER_TIME',
162 'function' => array('name'=>'getReminderTime', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php', 'onListView'=>true),
164 'reportable' => false,
167 'comment' => 'Specifies when a reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
172 'name' => 'outlook_id',
173 'vname' => 'LBL_OUTLOOK_ID',
176 'reportable' => false,
177 'comment' => 'When the Sugar Plug-in for Microsoft Outlook syncs an Outlook appointment, this is the Outlook appointment item ID'
179 'accept_status' => array (
180 'name' => 'accept_status',
181 'vname' => 'LBL_SUBJECT',
182 'dbType' => 'varchar',
188 'set_accept_links' => array (
189 'name' => 'accept_status',
190 'vname' => 'LBL_SUBJECT',
191 'dbType' => 'varchar',
198 'name' => 'contact_name',
199 'rname' => 'last_name',
200 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
201 'id_name' => 'contact_id',
202 'massupdate' => false,
203 'vname' => 'LBL_CONTACT_NAME',
206 'table' => 'contacts',
208 'module' => 'Contacts',
209 'join_name' => 'contacts',
210 'dbType' => 'varchar',
213 'importable' => 'false',
214 'studio' => array('required' => false, 'listview'=>true, 'visible' => false),
220 'relationship' => 'account_calls',
223 'vname'=>'LBL_OLD_ACCOUNT_LINK',
227 'name' => 'opportunity',
229 'relationship' => 'opportunity_calls',
232 'vname'=>'LBL_OPPORTUNITY',
238 'relationship' => 'calls_leads',
240 'vname'=>'LBL_LEADS',
246 'relationship' => 'case_calls',
253 'name' => 'accounts',
255 'relationship' => 'account_calls',
256 'module'=>'Accounts',
257 'bean_name'=>'Account',
259 'vname'=>'LBL_ACCOUNT',
263 'name' => 'contacts',
265 'relationship' => 'calls_contacts',
267 'vname'=>'LBL_CONTACTS',
273 'relationship' => 'calls_users',
275 'vname'=>'LBL_USERS',
281 'relationship' => 'calls_notes',
285 'vname'=>'LBL_NOTES',
289 'name' => 'created_by_link',
291 'relationship' => 'calls_created_by',
292 'vname' => 'LBL_CREATED_BY_USER',
293 'link_type' => 'one',
298 'modified_user_link' =>
300 'name' => 'modified_user_link',
302 'relationship' => 'calls_modified_user',
303 'vname' => 'LBL_MODIFIED_BY_USER',
304 'link_type' => 'one',
309 'assigned_user_link' =>
311 'name' => 'assigned_user_link',
313 'relationship' => 'calls_assigned_user',
314 'vname' => 'LBL_ASSIGNED_TO_USER',
315 'link_type' => 'one',
320 'contact_id' => array(
321 'name' => 'contact_id',
323 'source' => 'non-db',
324 'importable' => false,
329 'name' => 'idx_call_name',
331 'fields'=> array('name'),
334 'name' => 'idx_status',
336 'fields'=> array('status'),
339 'name' => 'idx_calls_date_start',
341 'fields' => array('date_start'),
344 'name' => 'idx_calls_par_del',
346 'fields' => array('parent_id','parent_type','deleted')
349 'relationships' => array (
350 'calls_assigned_user' => array(
351 'lhs_module' => 'Users',
352 'lhs_table' => 'users',
354 'rhs_module' => 'Calls',
355 'rhs_table' => 'calls',
356 'rhs_key' => 'assigned_user_id',
357 'relationship_type' => 'one-to-many'
359 'calls_modified_user' => array(
360 'lhs_module' => 'Users',
361 'lhs_table' => 'users',
363 'rhs_module' => 'Calls',
364 'rhs_table' => 'calls',
365 'rhs_key' => 'modified_user_id',
366 'relationship_type' => 'one-to-many'
368 'calls_created_by' => array(
369 'lhs_module' => 'Users',
370 'lhs_table' => 'users',
372 'rhs_module' => 'Calls',
373 'rhs_table' => 'calls',
374 'rhs_key' => 'created_by',
375 'relationship_type' => 'one-to-many'
377 'calls_notes' => array(
378 'lhs_module' => 'Calls',
379 'lhs_table' => 'calls',
381 'rhs_module' => 'Notes',
382 'rhs_table' => 'notes',
383 'rhs_key' => 'parent_id',
384 'relationship_type' => 'one-to-many',
387 //This enables optimistic locking for Saves From EditView
388 'optimistic_locking' => true,
391 VardefManager::createVardef('Calls','Call', array('default', 'assignable',