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