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 ********************************************************************************/
38 $dictionary['Call'] = array('table' => 'calls', 'comment' => 'A Call is an activity representing a phone call',
39 'unified_search' => true, 'full_text_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,
50 'full_text_search' => array('boost' => 3),
52 'importable' => 'required',
57 'name' => 'duration_hours',
58 'vname' => 'LBL_DURATION_HOURS',
61 'comment' => 'Call duration, hours portion',
66 'name' => 'duration_minutes',
67 'vname' => 'LBL_DURATION_MINUTES',
69 'function' => array('name'=>'getDurationMinutesOptions', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php'),
71 'group'=>'duration_hours',
72 'importable' => 'required',
73 'comment' => 'Call duration, minutes portion'
78 'name' => 'date_start',
79 'vname' => 'LBL_DATE',
80 'type' => 'datetimecombo',
81 'dbType' => 'datetime',
82 'comment' => 'Date in which call is schedule to (or did) start',
83 'importable' => 'required',
85 'enable_range_search' => true,
86 'options' => 'date_range_search_dom',
92 'vname' => 'LBL_DATE_END',
93 'type' => 'datetimecombo',
94 'dbType' => 'datetime',
96 'comment' => 'Date is which call is scheduled to (or did) end',
97 'enable_range_search' => true,
98 'options' => 'date_range_search_dom',
103 'name'=>'parent_type',
104 'vname'=>'LBL_PARENT_TYPE',
105 'type' => 'parent_type',
108 'group'=>'parent_name',
109 'options'=> 'parent_type_display',
111 'comment' => 'The Sugar object to which the call is related'
116 'name'=> 'parent_name',
117 'parent_type'=>'record_type_display' ,
118 'type_name'=>'parent_type',
119 'id_name'=>'parent_id',
120 'vname'=>'LBL_LIST_RELATED_TO',
122 'group'=>'parent_name',
124 'options'=> 'parent_type_display',
129 'vname' => 'LBL_STATUS',
132 'options' => 'call_status_dom',
133 'comment' => 'The status of the call (Held, Not Held, etc.)',
135 'importable' => 'required',
136 'default' => 'Planned',
137 'studio' => array('detailview'=>false)
141 'name' => 'direction',
142 'vname' => 'LBL_DIRECTION',
145 'options' => 'call_direction_dom',
146 'comment' => 'Indicates whether call is inbound or outbound'
151 'vname'=>'LBL_LIST_RELATED_TO_ID',
153 'group'=>'parent_name',
155 'comment' => 'The ID of the parent Sugar object identified by parent_type'
157 'reminder_checked' => array(
158 'name' => 'reminder_checked',
159 'vname' => 'LBL_REMINDER',
161 'source' => 'non-db',
162 'comment' => 'checkbox indicating whether or not the reminder value is set (Meta-data only)',
163 'massupdate' => false,
167 'name' => 'reminder_time',
168 'vname' => 'LBL_REMINDER_TIME',
171 'options' => 'reminder_time_options',
172 'reportable' => false,
173 'massupdate' => false,
175 'comment' => 'Specifies when a reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
177 'email_reminder_checked' => array(
178 'name' => 'email_reminder_checked',
179 'vname' => 'LBL_EMAIL_REMINDER',
181 'source' => 'non-db',
182 'comment' => 'checkbox indicating whether or not the email reminder value is set (Meta-data only)',
183 'massupdate' => false,
185 'email_reminder_time' =>
187 'name' => 'email_reminder_time',
188 'vname' => 'LBL_EMAIL_REMINDER_TIME',
191 'options' => 'reminder_time_options',
192 'reportable' => false,
193 'massupdate' => false,
195 'comment' => 'Specifies when a email reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
197 'email_reminder_sent' => array(
198 'name' => 'email_reminder_sent',
199 'vname' => 'LBL_EMAIL_REMINDER_SENT',
202 'comment' => 'Whether email reminder is already sent',
204 'massupdate'=> false,
208 'name' => 'outlook_id',
209 'vname' => 'LBL_OUTLOOK_ID',
212 'reportable' => false,
213 'comment' => 'When the Sugar Plug-in for Microsoft Outlook syncs an Outlook appointment, this is the Outlook appointment item ID'
215 'accept_status' => array (
216 'name' => 'accept_status',
217 'vname' => 'LBL_ACCEPT_STATUS',
218 'dbType' => 'varchar',
224 'set_accept_links' => array (
225 'name' => 'accept_status',
226 'vname' => 'LBL_ACCEPT_LINK',
227 'dbType' => 'varchar',
234 'name' => 'contact_name',
235 'rname' => 'last_name',
236 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
237 'id_name' => 'contact_id',
238 'massupdate' => false,
239 'vname' => 'LBL_CONTACT_NAME',
242 'table' => 'contacts',
244 'module' => 'Contacts',
245 'join_name' => 'contacts',
246 'dbType' => 'varchar',
249 'importable' => 'false',
250 'studio' => array('required' => false, 'listview'=>true, 'visible' => false),
254 'name' => 'opportunities',
256 'relationship' => 'opportunity_calls',
259 'vname'=>'LBL_OPPORTUNITY',
265 'relationship' => 'calls_leads',
267 'vname'=>'LBL_LEADS',
269 // Bug #42619 Missed back-relation from Project module
273 'relationship' => 'projects_calls',
274 'source' => 'non-db',
275 'vname' => 'LBL_PROJECTS'
281 'relationship' => 'case_calls',
288 'name' => 'accounts',
290 'relationship' => 'account_calls',
291 'module'=>'Accounts',
292 'bean_name'=>'Account',
294 'vname'=>'LBL_ACCOUNT',
298 'name' => 'contacts',
300 'relationship' => 'calls_contacts',
302 'vname'=>'LBL_CONTACTS',
308 'relationship' => 'calls_users',
310 'vname'=>'LBL_USERS',
316 'relationship' => 'calls_notes',
320 'vname'=>'LBL_NOTES',
324 'name' => 'created_by_link',
326 'relationship' => 'calls_created_by',
327 'vname' => 'LBL_CREATED_BY_USER',
328 'link_type' => 'one',
333 'modified_user_link' =>
335 'name' => 'modified_user_link',
337 'relationship' => 'calls_modified_user',
338 'vname' => 'LBL_MODIFIED_BY_USER',
339 'link_type' => 'one',
344 'assigned_user_link' =>
346 'name' => 'assigned_user_link',
348 'relationship' => 'calls_assigned_user',
349 'vname' => 'LBL_ASSIGNED_TO_USER',
350 'link_type' => 'one',
355 'contact_id' => array(
356 'name' => 'contact_id',
358 'source' => 'non-db',
362 'name' => 'repeat_type',
363 'vname' => 'LBL_REPEAT_TYPE',
366 'options' => 'repeat_type_dom',
367 'comment' => 'Type of recurrence',
368 'importable' => 'false',
369 'massupdate' => false,
370 'reportable' => false,
375 'name' => 'repeat_interval',
376 'vname' => 'LBL_REPEAT_INTERVAL',
380 'comment' => 'Interval of recurrence',
381 'importable' => 'false',
382 'massupdate' => false,
383 'reportable' => false,
388 'name' => 'repeat_dow',
389 'vname' => 'LBL_REPEAT_DOW',
392 'comment' => 'Days of week in recurrence',
393 'importable' => 'false',
394 'massupdate' => false,
395 'reportable' => false,
400 'name' => 'repeat_until',
401 'vname' => 'LBL_REPEAT_UNTIL',
403 'comment' => 'Repeat until specified date',
404 'importable' => 'false',
405 'massupdate' => false,
406 'reportable' => false,
411 'name' => 'repeat_count',
412 'vname' => 'LBL_REPEAT_COUNT',
415 'comment' => 'Number of recurrence',
416 'importable' => 'false',
417 'massupdate' => false,
418 'reportable' => false,
421 'repeat_parent_id' =>
423 'name' => 'repeat_parent_id',
424 'vname' => 'LBL_REPEAT_PARENT_ID',
427 'comment' => 'Id of the first element of recurring records',
428 'importable' => 'false',
429 'massupdate' => false,
430 'reportable' => false,
433 'recurring_source' =>
435 'name' => 'recurring_source',
436 'vname' => 'LBL_RECURRING_SOURCE',
439 'comment' => 'Source of recurring call',
440 'importable' => false,
441 'massupdate' => false,
442 'reportable' => false,
445 'add_parent_invitee' =>
447 'name' => 'add_parent_invitee',
448 'vname' => 'LBL_ADD_PARENT_INVITEE',
450 'source' => 'non-db',
451 'comment' => 'Helper field for Add To Parent link',
452 'massupdate' => false,
453 'reportable' => false,
454 'importable' => false,
459 'name' => 'idx_call_name',
461 'fields'=> array('name'),
464 'name' => 'idx_status',
466 'fields'=> array('status'),
469 'name' => 'idx_calls_date_start',
471 'fields' => array('date_start'),
474 'name' => 'idx_calls_par_del',
476 'fields' => array('parent_id','parent_type','deleted')
479 'name' =>'idx_calls_assigned_del',
481 'fields'=>array( 'deleted', 'assigned_user_id')),
483 'relationships' => array (
484 'calls_assigned_user' => array(
485 'lhs_module' => 'Users',
486 'lhs_table' => 'users',
488 'rhs_module' => 'Calls',
489 'rhs_table' => 'calls',
490 'rhs_key' => 'assigned_user_id',
491 'relationship_type' => 'one-to-many'
493 'calls_modified_user' => array(
494 'lhs_module' => 'Users',
495 'lhs_table' => 'users',
497 'rhs_module' => 'Calls',
498 'rhs_table' => 'calls',
499 'rhs_key' => 'modified_user_id',
500 'relationship_type' => 'one-to-many'
502 'calls_created_by' => array(
503 'lhs_module' => 'Users',
504 'lhs_table' => 'users',
506 'rhs_module' => 'Calls',
507 'rhs_table' => 'calls',
508 'rhs_key' => 'created_by',
509 'relationship_type' => 'one-to-many'
511 'calls_notes' => array(
512 'lhs_module' => 'Calls',
513 'lhs_table' => 'calls',
515 'rhs_module' => 'Notes',
516 'rhs_table' => 'notes',
517 'rhs_key' => 'parent_id',
518 'relationship_type' => 'one-to-many',
519 'relationship_role_column'=>'parent_type',
520 'relationship_role_column_value'=>'Calls',
523 //This enables optimistic locking for Saves From EditView
524 'optimistic_locking' => true,
527 VardefManager::createVardef('Calls','Call', array('default', 'assignable',