]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Calls/vardefs.php
Release 6.2.3
[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-2011 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_SUBJECT',
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_SUBJECT',
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   'account' =>
224   array (
225         'name' => 'account',
226     'type' => 'link',
227     'relationship' => 'account_calls',
228                 'link_type'=>'one',
229     'source'=>'non-db',
230                 'vname'=>'LBL_OLD_ACCOUNT_LINK',
231   ),
232   'opportunity' =>
233   array (
234         'name' => 'opportunity',
235     'type' => 'link',
236     'relationship' => 'opportunity_calls',
237     'source'=>'non-db',
238                 'link_type'=>'one',
239                 'vname'=>'LBL_OPPORTUNITY',
240   ),
241   'leads' =>
242   array (
243     'name' => 'leads',
244     'type' => 'link',
245     'relationship' => 'calls_leads',
246     'source'=>'non-db',
247         'vname'=>'LBL_LEADS',
248   ),
249   'case' =>
250   array (
251         'name' => 'case',
252     'type' => 'link',
253     'relationship' => 'case_calls',
254     'source'=>'non-db',
255                 'link_type'=>'one',
256                 'vname'=>'LBL_CASE',
257   ),
258   'accounts' =>
259   array (
260     'name' => 'accounts',
261     'type' => 'link',
262     'relationship' => 'account_calls',
263     'module'=>'Accounts',
264     'bean_name'=>'Account',
265     'source'=>'non-db',
266     'vname'=>'LBL_ACCOUNT',
267   ),
268   'contacts' =>
269   array (
270         'name' => 'contacts',
271     'type' => 'link',
272     'relationship' => 'calls_contacts',
273     'source'=>'non-db',
274                 'vname'=>'LBL_CONTACTS',
275   ),
276   'users' =>
277   array (
278         'name' => 'users',
279     'type' => 'link',
280     'relationship' => 'calls_users',
281     'source'=>'non-db',
282                 'vname'=>'LBL_USERS',
283   ),
284  'notes' =>
285   array (
286         'name' => 'notes',
287     'type' => 'link',
288     'relationship' => 'calls_notes',
289     'module'=>'Notes',
290     'bean_name'=>'Note',
291     'source'=>'non-db',
292                 'vname'=>'LBL_NOTES',
293   ),
294   'created_by_link' =>
295   array (
296         'name' => 'created_by_link',
297     'type' => 'link',
298     'relationship' => 'calls_created_by',
299     'vname' => 'LBL_CREATED_BY_USER',
300     'link_type' => 'one',
301     'module'=>'Users',
302     'bean_name'=>'User',
303     'source'=>'non-db',
304   ),
305   'modified_user_link' =>
306   array (
307         'name' => 'modified_user_link',
308     'type' => 'link',
309     'relationship' => 'calls_modified_user',
310     'vname' => 'LBL_MODIFIED_BY_USER',
311     'link_type' => 'one',
312     'module'=>'Users',
313     'bean_name'=>'User',
314     'source'=>'non-db',
315   ),
316   'assigned_user_link' =>
317   array (
318         'name' => 'assigned_user_link',
319     'type' => 'link',
320     'relationship' => 'calls_assigned_user',
321     'vname' => 'LBL_ASSIGNED_TO_USER',
322     'link_type' => 'one',
323     'module'=>'Users',
324     'bean_name'=>'User',
325     'source'=>'non-db',
326   ),
327         'contact_id' => array(
328                 'name' => 'contact_id',
329                 'type' => 'id',
330                 'source' => 'non-db',
331                 'importable' => false,
332         ),
333 ),
334 'indices' => array (
335         array(
336                 'name' => 'idx_call_name',
337                 'type' => 'index',
338                 'fields'=> array('name'),
339         ),
340         array(
341                 'name' => 'idx_status',
342                 'type' => 'index',
343                 'fields'=> array('status'),
344         ),
345     array(
346         'name' => 'idx_calls_date_start',
347         'type' => 'index',
348         'fields' => array('date_start'),
349     ),
350     array (
351         'name' => 'idx_calls_par_del',
352         'type' => 'index',
353         'fields' => array('parent_id','parent_type','deleted')
354     )
355 ),
356 'relationships' => array (
357                 'calls_assigned_user' => array(
358                         'lhs_module'            => 'Users',
359                         'lhs_table'                     => 'users',
360                         'lhs_key'                       => 'id',
361                         'rhs_module'            => 'Calls',
362                         'rhs_table'                     => 'calls',
363                         'rhs_key'                       => 'assigned_user_id',
364                         'relationship_type'     => 'one-to-many'
365                 ),
366                 'calls_modified_user' => array(
367                         'lhs_module'            => 'Users',
368                         'lhs_table'                     => 'users',
369                         'lhs_key'                       => 'id',
370                         'rhs_module'            => 'Calls',
371                         'rhs_table'                     => 'calls',
372                         'rhs_key'                       => 'modified_user_id',
373                         'relationship_type'     => 'one-to-many'
374                 ),
375                 'calls_created_by' => array(
376                         'lhs_module'            => 'Users',
377                         'lhs_table'                     => 'users',
378                         'lhs_key'                       => 'id',
379                         'rhs_module'            => 'Calls',
380                         'rhs_table'                     => 'calls',
381                         'rhs_key'                       => 'created_by',
382                         'relationship_type'     => 'one-to-many'
383                 ),
384                 'calls_notes' => array(
385                         'lhs_module'            => 'Calls',
386                         'lhs_table'                     => 'calls',
387                         'lhs_key'                       => 'id',
388                         'rhs_module'            => 'Notes',
389                         'rhs_table'                     => 'notes',
390                         'rhs_key'                       => 'parent_id',
391                         'relationship_type'     => 'one-to-many',
392                 ),
393         ),
394 //This enables optimistic locking for Saves From EditView
395         'optimistic_locking'    => true,
396 );
397
398 VardefManager::createVardef('Calls','Call', array('default', 'assignable',
399 ));
400 ?>