]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Calls/vardefs.php
Release 6.4.1
[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, '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         'required'=>true,
51     'importable' => 'required',
52   ),
53
54   'duration_hours' =>
55   array (
56     'name' => 'duration_hours',
57     'vname' => 'LBL_DURATION_HOURS',
58     'type' => 'int',
59     'len' => '2',
60     'comment' => 'Call duration, hours portion',
61         'required' => true,
62   ),
63   'duration_minutes' =>
64   array (
65     'name' => 'duration_minutes',
66     'vname' => 'LBL_DURATION_MINUTES',
67     'type' => 'int',
68     'function' => array('name'=>'getDurationMinutesOptions', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php'),
69     'len' => '2',
70     'group'=>'duration_hours',
71     'importable' => 'required',
72     'comment' => 'Call duration, minutes portion'
73   ),
74
75    'date_start' =>
76   array (
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',
83         'required' => true,
84     'enable_range_search' => true,
85     'options' => 'date_range_search_dom',
86   ),
87
88   'date_end' =>
89   array (
90     'name' => 'date_end',
91     'vname' => 'LBL_DATE_END',
92     'type' => 'datetimecombo',
93         'dbType' => 'datetime',
94     'massupdate'=>false,
95     'comment' => 'Date is which call is scheduled to (or did) end',
96     'enable_range_search' => true,
97     'options' => 'date_range_search_dom',
98   ),
99
100  'parent_type'=>
101   array(
102         'name'=>'parent_type',
103         'vname'=>'LBL_PARENT_TYPE',
104     'type' => 'parent_type',
105     'dbType'=>'varchar',
106         'required'=>false,
107         'group'=>'parent_name',
108     'options'=> 'parent_type_display',
109         'len'=>255,
110       'comment' => 'The Sugar object to which the call is related'
111         ),
112
113   'parent_name'=>
114   array(
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',
120                 'type'=>'parent',
121                 'group'=>'parent_name',
122                 'source'=>'non-db',
123                 'options'=> 'parent_type_display',
124   ),
125   'status' =>
126   array (
127     'name' => 'status',
128     'vname' => 'LBL_STATUS',
129     'type' => 'enum',
130     'len' => 100,
131     'options' => 'call_status_dom',
132     'comment' => 'The status of the call (Held, Not Held, etc.)',
133         'required' => true,
134         'importable' => 'required',
135     'default' => 'Planned',
136         'studio' => array('detailview'=>false)
137   ),
138   'direction' =>
139   array (
140     'name' => 'direction',
141     'vname' => 'LBL_DIRECTION',
142     'type' => 'enum',
143     'len' => 100,
144     'options' => 'call_direction_dom',
145     'comment' => 'Indicates whether call is inbound or outbound'
146   ),
147   'parent_id'=>
148   array(
149         'name'=>'parent_id',
150         'vname'=>'LBL_LIST_RELATED_TO_ID',
151         'type'=>'id',
152         'group'=>'parent_name',
153                 'reportable'=>false,
154       'comment' => 'The ID of the parent Sugar object identified by parent_type'
155         ),
156    'reminder_checked'=>array(
157     'name' => 'reminder_checked',
158     'vname' => 'LBL_REMINDER',
159     'type' => 'bool',
160     'source' => 'non-db',
161     'comment' => 'checkbox indicating whether or not the reminder value is set (Meta-data only)',
162     'massupdate'=>false,
163    ),
164
165    'reminder_time'=>array (
166     'name' => 'reminder_time',
167     'vname' => 'LBL_REMINDER_TIME',
168     'type' => 'int',
169     'function' => array('name'=>'getReminderTime', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php', 'onListView'=>true),
170     'required' => false,
171     'reportable' => false,
172     'default' => -1,
173     'len' => '4',
174     'comment' => 'Specifies when a reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
175   ),
176
177   'outlook_id' =>
178   array (
179     'name' => 'outlook_id',
180     'vname' => 'LBL_OUTLOOK_ID',
181     'type' => 'varchar',
182     'len' => '255',
183     'reportable' => false,
184     'comment' => 'When the Sugar Plug-in for Microsoft Outlook syncs an Outlook appointment, this is the Outlook appointment item ID'
185   ),
186   'accept_status' => array (
187     'name' => 'accept_status',
188     'vname' => 'LBL_ACCEPT_STATUS',
189     'dbType' => 'varchar',
190     'type' => 'varchar',
191     'len' => '20',
192     'source'=>'non-db',
193   ),
194   //bug 39559 
195   'set_accept_links' => array (
196     'name' => 'accept_status',
197     'vname' => 'LBL_ACCEPT_LINK',
198     'dbType' => 'varchar',
199     'type' => 'varchar',
200     'len' => '20',
201     'source'=>'non-db',
202   ),
203   'contact_name' =>
204   array (
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',
211     'type' => 'relate',
212     'link'=>'contacts',
213     'table' => 'contacts',
214     'isnull' => 'true',
215     'module' => 'Contacts',
216     'join_name' => 'contacts',
217     'dbType' => 'varchar',
218     'source'=>'non-db',
219     'len' => 36,
220     'importable' => 'false',
221     'studio' => array('required' => false, 'listview'=>true, 'visible' => false),
222   ),
223   'opportunities' =>
224   array (
225         'name' => 'opportunities',
226     'type' => 'link',
227     'relationship' => 'opportunity_calls',
228     'source'=>'non-db',
229                 'link_type'=>'one',
230                 'vname'=>'LBL_OPPORTUNITY',
231   ),
232   'leads' =>
233   array (
234     'name' => 'leads',
235     'type' => 'link',
236     'relationship' => 'calls_leads',
237     'source'=>'non-db',
238         'vname'=>'LBL_LEADS',
239   ),
240   'case' =>
241   array (
242         'name' => 'case',
243     'type' => 'link',
244     'relationship' => 'case_calls',
245     'source'=>'non-db',
246                 'link_type'=>'one',
247                 'vname'=>'LBL_CASE',
248   ),
249   'accounts' =>
250   array (
251     'name' => 'accounts',
252     'type' => 'link',
253     'relationship' => 'account_calls',
254     'module'=>'Accounts',
255     'bean_name'=>'Account',
256     'source'=>'non-db',
257     'vname'=>'LBL_ACCOUNT',
258   ),
259   'contacts' =>
260   array (
261         'name' => 'contacts',
262     'type' => 'link',
263     'relationship' => 'calls_contacts',
264     'source'=>'non-db',
265                 'vname'=>'LBL_CONTACTS',
266   ),
267   'users' =>
268   array (
269         'name' => 'users',
270     'type' => 'link',
271     'relationship' => 'calls_users',
272     'source'=>'non-db',
273                 'vname'=>'LBL_USERS',
274   ),
275  'notes' =>
276   array (
277         'name' => 'notes',
278     'type' => 'link',
279     'relationship' => 'calls_notes',
280     'module'=>'Notes',
281     'bean_name'=>'Note',
282     'source'=>'non-db',
283                 'vname'=>'LBL_NOTES',
284   ),
285   'created_by_link' =>
286   array (
287         'name' => 'created_by_link',
288     'type' => 'link',
289     'relationship' => 'calls_created_by',
290     'vname' => 'LBL_CREATED_BY_USER',
291     'link_type' => 'one',
292     'module'=>'Users',
293     'bean_name'=>'User',
294     'source'=>'non-db',
295   ),
296   'modified_user_link' =>
297   array (
298         'name' => 'modified_user_link',
299     'type' => 'link',
300     'relationship' => 'calls_modified_user',
301     'vname' => 'LBL_MODIFIED_BY_USER',
302     'link_type' => 'one',
303     'module'=>'Users',
304     'bean_name'=>'User',
305     'source'=>'non-db',
306   ),
307   'assigned_user_link' =>
308   array (
309         'name' => 'assigned_user_link',
310     'type' => 'link',
311     'relationship' => 'calls_assigned_user',
312     'vname' => 'LBL_ASSIGNED_TO_USER',
313     'link_type' => 'one',
314     'module'=>'Users',
315     'bean_name'=>'User',
316     'source'=>'non-db',
317   ),
318         'contact_id' => array(
319                 'name' => 'contact_id',
320                 'type' => 'id',
321                 'source' => 'non-db',
322         ),
323 ),
324 'indices' => array (
325         array(
326                 'name' => 'idx_call_name',
327                 'type' => 'index',
328                 'fields'=> array('name'),
329         ),
330         array(
331                 'name' => 'idx_status',
332                 'type' => 'index',
333                 'fields'=> array('status'),
334         ),
335     array(
336         'name' => 'idx_calls_date_start',
337         'type' => 'index',
338         'fields' => array('date_start'),
339     ),
340     array (
341         'name' => 'idx_calls_par_del',
342         'type' => 'index',
343         'fields' => array('parent_id','parent_type','deleted')
344     ),
345     array(
346         'name' =>'idx_calls_assigned_del',
347         'type' =>'index',
348         'fields'=>array( 'deleted', 'assigned_user_id')),
349 ),
350 'relationships' => array (
351                 'calls_assigned_user' => array(
352                         'lhs_module'            => 'Users',
353                         'lhs_table'                     => 'users',
354                         'lhs_key'                       => 'id',
355                         'rhs_module'            => 'Calls',
356                         'rhs_table'                     => 'calls',
357                         'rhs_key'                       => 'assigned_user_id',
358                         'relationship_type'     => 'one-to-many'
359                 ),
360                 'calls_modified_user' => array(
361                         'lhs_module'            => 'Users',
362                         'lhs_table'                     => 'users',
363                         'lhs_key'                       => 'id',
364                         'rhs_module'            => 'Calls',
365                         'rhs_table'                     => 'calls',
366                         'rhs_key'                       => 'modified_user_id',
367                         'relationship_type'     => 'one-to-many'
368                 ),
369                 'calls_created_by' => array(
370                         'lhs_module'            => 'Users',
371                         'lhs_table'                     => 'users',
372                         'lhs_key'                       => 'id',
373                         'rhs_module'            => 'Calls',
374                         'rhs_table'                     => 'calls',
375                         'rhs_key'                       => 'created_by',
376                         'relationship_type'     => 'one-to-many'
377                 ),
378                 'calls_notes' => array(
379                         'lhs_module'            => 'Calls',
380                         'lhs_table'                     => 'calls',
381                         'lhs_key'                       => 'id',
382                         'rhs_module'            => 'Notes',
383                         'rhs_table'                     => 'notes',
384                         'rhs_key'                       => 'parent_id',
385                         'relationship_type'     => 'one-to-many',
386       'relationship_role_column'=>'parent_type',
387       'relationship_role_column_value'=>'Calls',
388                 ),
389         ),
390 //This enables optimistic locking for Saves From EditView
391         'optimistic_locking'    => true,
392 );
393
394 VardefManager::createVardef('Calls','Call', array('default', 'assignable',
395 ));
396 ?>