]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Calls/vardefs.php
Merge pull request #100 from collinlee/master
[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     // Bug #42619 Missed back-relation from Project module
241     'project'=> array (
242         'name' => 'project',
243         'type' => 'link',
244         'relationship' => 'projects_calls',
245         'source' => 'non-db',
246         'vname' => 'LBL_PROJECTS'
247     ),
248   'case' =>
249   array (
250         'name' => 'case',
251     'type' => 'link',
252     'relationship' => 'case_calls',
253     'source'=>'non-db',
254                 'link_type'=>'one',
255                 'vname'=>'LBL_CASE',
256   ),
257   'accounts' =>
258   array (
259     'name' => 'accounts',
260     'type' => 'link',
261     'relationship' => 'account_calls',
262     'module'=>'Accounts',
263     'bean_name'=>'Account',
264     'source'=>'non-db',
265     'vname'=>'LBL_ACCOUNT',
266   ),
267   'contacts' =>
268   array (
269         'name' => 'contacts',
270     'type' => 'link',
271     'relationship' => 'calls_contacts',
272     'source'=>'non-db',
273                 'vname'=>'LBL_CONTACTS',
274   ),
275   'users' =>
276   array (
277         'name' => 'users',
278     'type' => 'link',
279     'relationship' => 'calls_users',
280     'source'=>'non-db',
281                 'vname'=>'LBL_USERS',
282   ),
283  'notes' =>
284   array (
285         'name' => 'notes',
286     'type' => 'link',
287     'relationship' => 'calls_notes',
288     'module'=>'Notes',
289     'bean_name'=>'Note',
290     'source'=>'non-db',
291                 'vname'=>'LBL_NOTES',
292   ),
293   'created_by_link' =>
294   array (
295         'name' => 'created_by_link',
296     'type' => 'link',
297     'relationship' => 'calls_created_by',
298     'vname' => 'LBL_CREATED_BY_USER',
299     'link_type' => 'one',
300     'module'=>'Users',
301     'bean_name'=>'User',
302     'source'=>'non-db',
303   ),
304   'modified_user_link' =>
305   array (
306         'name' => 'modified_user_link',
307     'type' => 'link',
308     'relationship' => 'calls_modified_user',
309     'vname' => 'LBL_MODIFIED_BY_USER',
310     'link_type' => 'one',
311     'module'=>'Users',
312     'bean_name'=>'User',
313     'source'=>'non-db',
314   ),
315   'assigned_user_link' =>
316   array (
317         'name' => 'assigned_user_link',
318     'type' => 'link',
319     'relationship' => 'calls_assigned_user',
320     'vname' => 'LBL_ASSIGNED_TO_USER',
321     'link_type' => 'one',
322     'module'=>'Users',
323     'bean_name'=>'User',
324     'source'=>'non-db',
325   ),
326         'contact_id' => array(
327                 'name' => 'contact_id',
328                 'type' => 'id',
329                 'source' => 'non-db',
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     array(
354         'name' =>'idx_calls_assigned_del',
355         'type' =>'index',
356         'fields'=>array( 'deleted', 'assigned_user_id')),
357 ),
358 'relationships' => array (
359                 'calls_assigned_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'                       => 'assigned_user_id',
366                         'relationship_type'     => 'one-to-many'
367                 ),
368                 'calls_modified_user' => array(
369                         'lhs_module'            => 'Users',
370                         'lhs_table'                     => 'users',
371                         'lhs_key'                       => 'id',
372                         'rhs_module'            => 'Calls',
373                         'rhs_table'                     => 'calls',
374                         'rhs_key'                       => 'modified_user_id',
375                         'relationship_type'     => 'one-to-many'
376                 ),
377                 'calls_created_by' => array(
378                         'lhs_module'            => 'Users',
379                         'lhs_table'                     => 'users',
380                         'lhs_key'                       => 'id',
381                         'rhs_module'            => 'Calls',
382                         'rhs_table'                     => 'calls',
383                         'rhs_key'                       => 'created_by',
384                         'relationship_type'     => 'one-to-many'
385                 ),
386                 'calls_notes' => array(
387                         'lhs_module'            => 'Calls',
388                         'lhs_table'                     => 'calls',
389                         'lhs_key'                       => 'id',
390                         'rhs_module'            => 'Notes',
391                         'rhs_table'                     => 'notes',
392                         'rhs_key'                       => 'parent_id',
393                         'relationship_type'     => 'one-to-many',
394       'relationship_role_column'=>'parent_type',
395       'relationship_role_column_value'=>'Calls',
396                 ),
397         ),
398 //This enables optimistic locking for Saves From EditView
399         'optimistic_locking'    => true,
400 );
401
402 VardefManager::createVardef('Calls','Call', array('default', 'assignable',
403 ));
404 ?>