]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Calls/vardefs.php
Release 6.5.6
[Github/sugarcrm.git] / modules / Calls / vardefs.php
1 <?php
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.
6  * 
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.
13  * 
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
17  * details.
18  * 
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
22  * 02110-1301 USA.
23  * 
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.
26  * 
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.
30  * 
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  ********************************************************************************/
37
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 (
40
41   'name' =>
42   array (
43     'name' => 'name',
44     'vname' => 'LBL_SUBJECT',
45     'dbType' => 'varchar',
46     'type' => 'name',
47     'len' => '50',
48     'comment' => 'Brief description of the call',
49     'unified_search' => true,
50     'full_text_search' => array('boost' => 3),
51         'required'=>true,
52     'importable' => 'required',
53   ),
54
55   'duration_hours' =>
56   array (
57     'name' => 'duration_hours',
58     'vname' => 'LBL_DURATION_HOURS',
59     'type' => 'int',
60     'len' => '2',
61     'comment' => 'Call duration, hours portion',
62         'required' => true,
63   ),
64   'duration_minutes' =>
65   array (
66     'name' => 'duration_minutes',
67     'vname' => 'LBL_DURATION_MINUTES',
68     'type' => 'int',
69     'function' => array('name'=>'getDurationMinutesOptions', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php'),
70     'len' => '2',
71     'group'=>'duration_hours',
72     'importable' => 'required',
73     'comment' => 'Call duration, minutes portion'
74   ),
75
76    'date_start' =>
77   array (
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',
84         'required' => true,
85     'enable_range_search' => true,
86     'options' => 'date_range_search_dom',
87   ),
88
89   'date_end' =>
90   array (
91     'name' => 'date_end',
92     'vname' => 'LBL_DATE_END',
93     'type' => 'datetimecombo',
94         'dbType' => 'datetime',
95     'massupdate'=>false,
96     'comment' => 'Date is which call is scheduled to (or did) end',
97     'enable_range_search' => true,
98     'options' => 'date_range_search_dom',
99   ),
100
101  'parent_type'=>
102   array(
103         'name'=>'parent_type',
104         'vname'=>'LBL_PARENT_TYPE',
105     'type' => 'parent_type',
106     'dbType'=>'varchar',
107         'required'=>false,
108         'group'=>'parent_name',
109     'options'=> 'parent_type_display',
110         'len'=>255,
111       'comment' => 'The Sugar object to which the call is related'
112         ),
113
114   'parent_name'=>
115   array(
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',
121                 'type'=>'parent',
122                 'group'=>'parent_name',
123                 'source'=>'non-db',
124                 'options'=> 'parent_type_display',
125   ),
126   'status' =>
127   array (
128     'name' => 'status',
129     'vname' => 'LBL_STATUS',
130     'type' => 'enum',
131     'len' => 100,
132     'options' => 'call_status_dom',
133     'comment' => 'The status of the call (Held, Not Held, etc.)',
134         'required' => true,
135         'importable' => 'required',
136     'default' => 'Planned',
137         'studio' => array('detailview'=>false)
138   ),
139   'direction' =>
140   array (
141     'name' => 'direction',
142     'vname' => 'LBL_DIRECTION',
143     'type' => 'enum',
144     'len' => 100,
145     'options' => 'call_direction_dom',
146     'comment' => 'Indicates whether call is inbound or outbound'
147   ),
148   'parent_id'=>
149   array(
150         'name'=>'parent_id',
151         'vname'=>'LBL_LIST_RELATED_TO_ID',
152         'type'=>'id',
153         'group'=>'parent_name',
154                 'reportable'=>false,
155       'comment' => 'The ID of the parent Sugar object identified by parent_type'
156         ),
157   'reminder_checked' => array(
158     'name' => 'reminder_checked',
159     'vname' => 'LBL_REMINDER',
160     'type' => 'bool',
161     'source' => 'non-db',
162     'comment' => 'checkbox indicating whether or not the reminder value is set (Meta-data only)',
163     'massupdate' => false,
164    ),
165   'reminder_time' =>
166   array (
167     'name' => 'reminder_time',
168     'vname' => 'LBL_REMINDER_TIME',
169     'type' => 'enum',
170     'dbType' => 'int',
171     'options' => 'reminder_time_options',
172     'reportable' => false,
173     'massupdate' => false,
174     'default'=> -1,
175     'comment' => 'Specifies when a reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
176   ),
177   'email_reminder_checked' => array(
178     'name' => 'email_reminder_checked',
179     'vname' => 'LBL_EMAIL_REMINDER',
180     'type' => 'bool',
181     'source' => 'non-db',
182     'comment' => 'checkbox indicating whether or not the email reminder value is set (Meta-data only)',
183     'massupdate' => false,
184    ),
185   'email_reminder_time' =>
186   array (
187     'name' => 'email_reminder_time',
188     'vname' => 'LBL_EMAIL_REMINDER_TIME',
189     'type' => 'enum',
190     'dbType' => 'int',
191     'options' => 'reminder_time_options',
192     'reportable' => false,
193     'massupdate' => false,
194     'default'=> -1,
195     'comment' => 'Specifies when a email reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
196   ),
197   'email_reminder_sent' => array( 
198     'name' => 'email_reminder_sent',
199     'vname' => 'LBL_EMAIL_REMINDER_SENT',
200     'default' => 0,
201     'type' => 'bool',
202     'comment' => 'Whether email reminder is already sent',
203     'studio' => false,
204     'massupdate'=> false,
205    ), 
206   'outlook_id' =>
207   array (
208     'name' => 'outlook_id',
209     'vname' => 'LBL_OUTLOOK_ID',
210     'type' => 'varchar',
211     'len' => '255',
212     'reportable' => false,
213     'comment' => 'When the Sugar Plug-in for Microsoft Outlook syncs an Outlook appointment, this is the Outlook appointment item ID'
214   ),
215   'accept_status' => array (
216     'name' => 'accept_status',
217     'vname' => 'LBL_ACCEPT_STATUS',
218     'dbType' => 'varchar',
219     'type' => 'varchar',
220     'len' => '20',
221     'source'=>'non-db',
222   ),
223   //bug 39559 
224   'set_accept_links' => array (
225     'name' => 'accept_status',
226     'vname' => 'LBL_ACCEPT_LINK',
227     'dbType' => 'varchar',
228     'type' => 'varchar',
229     'len' => '20',
230     'source'=>'non-db',
231   ),
232   'contact_name' =>
233   array (
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',
240     'type' => 'relate',
241     'link'=>'contacts',
242     'table' => 'contacts',
243     'isnull' => 'true',
244     'module' => 'Contacts',
245     'join_name' => 'contacts',
246     'dbType' => 'varchar',
247     'source'=>'non-db',
248     'len' => 36,
249     'importable' => 'false',
250     'studio' => array('required' => false, 'listview'=>true, 'visible' => false),
251   ),
252   'opportunities' =>
253   array (
254         'name' => 'opportunities',
255     'type' => 'link',
256     'relationship' => 'opportunity_calls',
257     'source'=>'non-db',
258                 'link_type'=>'one',
259                 'vname'=>'LBL_OPPORTUNITY',
260   ),
261   'leads' =>
262   array (
263     'name' => 'leads',
264     'type' => 'link',
265     'relationship' => 'calls_leads',
266     'source'=>'non-db',
267         'vname'=>'LBL_LEADS',
268   ),
269     // Bug #42619 Missed back-relation from Project module
270     'project'=> array (
271         'name' => 'project',
272         'type' => 'link',
273         'relationship' => 'projects_calls',
274         'source' => 'non-db',
275         'vname' => 'LBL_PROJECTS'
276     ),
277   'case' =>
278   array (
279         'name' => 'case',
280     'type' => 'link',
281     'relationship' => 'case_calls',
282     'source'=>'non-db',
283                 'link_type'=>'one',
284                 'vname'=>'LBL_CASE',
285   ),
286   'accounts' =>
287   array (
288     'name' => 'accounts',
289     'type' => 'link',
290     'relationship' => 'account_calls',
291     'module'=>'Accounts',
292     'bean_name'=>'Account',
293     'source'=>'non-db',
294     'vname'=>'LBL_ACCOUNT',
295   ),
296   'contacts' =>
297   array (
298         'name' => 'contacts',
299     'type' => 'link',
300     'relationship' => 'calls_contacts',
301     'source'=>'non-db',
302                 'vname'=>'LBL_CONTACTS',
303   ),
304   'users' =>
305   array (
306         'name' => 'users',
307     'type' => 'link',
308     'relationship' => 'calls_users',
309     'source'=>'non-db',
310                 'vname'=>'LBL_USERS',
311   ),
312  'notes' =>
313   array (
314         'name' => 'notes',
315     'type' => 'link',
316     'relationship' => 'calls_notes',
317     'module'=>'Notes',
318     'bean_name'=>'Note',
319     'source'=>'non-db',
320                 'vname'=>'LBL_NOTES',
321   ),
322   'created_by_link' =>
323   array (
324         'name' => 'created_by_link',
325     'type' => 'link',
326     'relationship' => 'calls_created_by',
327     'vname' => 'LBL_CREATED_BY_USER',
328     'link_type' => 'one',
329     'module'=>'Users',
330     'bean_name'=>'User',
331     'source'=>'non-db',
332   ),
333   'modified_user_link' =>
334   array (
335         'name' => 'modified_user_link',
336     'type' => 'link',
337     'relationship' => 'calls_modified_user',
338     'vname' => 'LBL_MODIFIED_BY_USER',
339     'link_type' => 'one',
340     'module'=>'Users',
341     'bean_name'=>'User',
342     'source'=>'non-db',
343   ),
344   'assigned_user_link' =>
345   array (
346         'name' => 'assigned_user_link',
347     'type' => 'link',
348     'relationship' => 'calls_assigned_user',
349     'vname' => 'LBL_ASSIGNED_TO_USER',
350     'link_type' => 'one',
351     'module'=>'Users',
352     'bean_name'=>'User',
353     'source'=>'non-db',
354   ),
355         'contact_id' => array(
356                 'name' => 'contact_id',
357                 'type' => 'id',
358                 'source' => 'non-db',
359         ),
360   'repeat_type' =>
361   array(
362     'name' => 'repeat_type',
363     'vname' => 'LBL_REPEAT_TYPE',
364     'type' => 'enum',
365     'len' => 36,
366     'options' => 'repeat_type_dom',
367     'comment' => 'Type of recurrence',
368     'importable' => 'false',
369     'massupdate' => false,
370     'reportable' => false,
371     'studio' => 'false',
372   ),  
373   'repeat_interval' =>
374   array(
375     'name' => 'repeat_interval',
376     'vname' => 'LBL_REPEAT_INTERVAL',
377     'type' => 'int',
378     'len' => 3,
379     'default' => 1,
380     'comment' => 'Interval of recurrence',
381     'importable' => 'false',
382     'massupdate' => false,
383     'reportable' => false,
384     'studio' => 'false',
385   ),  
386   'repeat_dow' =>
387   array(
388     'name' => 'repeat_dow',
389     'vname' => 'LBL_REPEAT_DOW',
390     'type' => 'varchar',
391     'len' => 7,
392     'comment' => 'Days of week in recurrence',
393     'importable' => 'false',
394     'massupdate' => false,
395     'reportable' => false,
396     'studio' => 'false',
397   ),  
398   'repeat_until' =>
399   array(
400     'name' => 'repeat_until',
401     'vname' => 'LBL_REPEAT_UNTIL',
402     'type' => 'date',
403     'comment' => 'Repeat until specified date',
404     'importable' => 'false',
405     'massupdate' => false,
406     'reportable' => false,
407     'studio' => 'false',
408   ),  
409   'repeat_count' =>
410   array(
411     'name' => 'repeat_count',
412     'vname' => 'LBL_REPEAT_COUNT',
413     'type' => 'int',
414     'len' => 7,
415     'comment' => 'Number of recurrence',
416     'importable' => 'false',
417     'massupdate' => false,
418     'reportable' => false,
419     'studio' => 'false',
420   ),
421   'repeat_parent_id' =>
422   array(
423     'name' => 'repeat_parent_id',
424     'vname' => 'LBL_REPEAT_PARENT_ID',
425     'type' => 'id',
426     'len' => 36,
427     'comment' => 'Id of the first element of recurring records',
428     'importable' => 'false',
429     'massupdate' => false,
430     'reportable' => false,
431     'studio' => 'false',
432   ),
433   'recurring_source' =>
434   array(
435     'name' => 'recurring_source',
436     'vname' => 'LBL_RECURRING_SOURCE',
437     'type' => 'varchar',
438     'len' => 36,
439     'comment' => 'Source of recurring call',
440     'importable' => false,
441     'massupdate' => false,
442     'reportable' => false,
443     'studio' => false,
444   ),
445   'add_parent_invitee' =>
446   array(
447         'name' => 'add_parent_invitee',
448         'vname' => 'LBL_ADD_PARENT_INVITEE',
449     'type' => 'varchar',
450         'source' => 'non-db',
451         'comment' => 'Helper field for Add To Parent link',
452         'massupdate' => false,
453         'reportable' => false,
454         'importable' => false,
455   ),
456 ),
457 'indices' => array (
458         array(
459                 'name' => 'idx_call_name',
460                 'type' => 'index',
461                 'fields'=> array('name'),
462         ),
463         array(
464                 'name' => 'idx_status',
465                 'type' => 'index',
466                 'fields'=> array('status'),
467         ),
468     array(
469         'name' => 'idx_calls_date_start',
470         'type' => 'index',
471         'fields' => array('date_start'),
472     ),
473     array (
474         'name' => 'idx_calls_par_del',
475         'type' => 'index',
476         'fields' => array('parent_id','parent_type','deleted')
477     ),
478     array(
479         'name' =>'idx_calls_assigned_del',
480         'type' =>'index',
481         'fields'=>array( 'deleted', 'assigned_user_id')),
482 ),
483 'relationships' => array (
484                 'calls_assigned_user' => array(
485                         'lhs_module'            => 'Users',
486                         'lhs_table'                     => 'users',
487                         'lhs_key'                       => 'id',
488                         'rhs_module'            => 'Calls',
489                         'rhs_table'                     => 'calls',
490                         'rhs_key'                       => 'assigned_user_id',
491                         'relationship_type'     => 'one-to-many'
492                 ),
493                 'calls_modified_user' => array(
494                         'lhs_module'            => 'Users',
495                         'lhs_table'                     => 'users',
496                         'lhs_key'                       => 'id',
497                         'rhs_module'            => 'Calls',
498                         'rhs_table'                     => 'calls',
499                         'rhs_key'                       => 'modified_user_id',
500                         'relationship_type'     => 'one-to-many'
501                 ),
502                 'calls_created_by' => array(
503                         'lhs_module'            => 'Users',
504                         'lhs_table'                     => 'users',
505                         'lhs_key'                       => 'id',
506                         'rhs_module'            => 'Calls',
507                         'rhs_table'                     => 'calls',
508                         'rhs_key'                       => 'created_by',
509                         'relationship_type'     => 'one-to-many'
510                 ),
511                 'calls_notes' => array(
512                         'lhs_module'            => 'Calls',
513                         'lhs_table'                     => 'calls',
514                         'lhs_key'                       => 'id',
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',
521                 ),
522         ),
523 //This enables optimistic locking for Saves From EditView
524         'optimistic_locking'    => true,
525 );
526
527 VardefManager::createVardef('Calls','Call', array('default', 'assignable',
528 ));
529 ?>