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