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.
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.
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
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
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.
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.
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 ********************************************************************************/
39 $dictionary['Email'] = array(
42 'comment' => 'Contains a record of emails sent to and from the Sugar application',
50 'comment' => 'Unique identifier',
52 'date_entered' => array (
53 'name' => 'date_entered',
54 'vname' => 'LBL_DATE_ENTERED',
57 'comment' => 'Date record created',
59 'date_modified' => array (
60 'name' => 'date_modified',
61 'vname' => 'LBL_DATE_MODIFIED',
64 'comment' => 'Date record last modified',
66 'assigned_user_id' => array (
67 'name' => 'assigned_user_id',
68 'rname' => 'user_name',
69 'id_name' => 'assigned_user_id',
70 'vname' => 'LBL_ASSIGNED_TO',
71 'type' => 'assigned_user_name',
76 'comment' => 'User ID that last modified record',
78 'assigned_user_name' => array (
79 'name' => 'assigned_user_name',
80 'vname' => 'LBL_ASSIGNED_TO',
86 'modified_user_id' => array (
87 'name' => 'modified_user_id',
88 'rname' => 'user_name',
89 'id_name' => 'modified_user_id',
90 'vname' => 'LBL_MODIFIED_BY',
91 'type' => 'assigned_user_name',
96 'comment' => 'User ID that last modified record',
98 'created_by' => array (
99 'name' => 'created_by',
100 'vname' => 'LBL_CREATED_BY',
103 'reportable' => false,
104 'comment' => 'User name who created record',
108 'vname' => 'LBL_DELETED',
112 'comment' => 'Record deletion indicator',
116 'from_addr' => array (
117 'name' => 'from_addr',
118 'vname' => 'LBL_FROM',
120 'comment' => 'Email address of the person sending the email',
122 'reply_to_addr' => array (
123 'name' => 'reply_to_addr',
124 'vname' => 'LBL_REPLY_TO_ADDRESS',
126 'comment' => 'Email address of person indicated in the Reply-to email field',
128 'to_addrs' => array (
129 'name' => 'to_addrs',
132 'comment' => 'Email address(es) of person(s) to receive the email',
134 'cc_addrs' => array (
135 'name' => 'cc_addrs',
138 'comment' => 'Email address(es) of person(s) to receive a carbon copy of the email',
140 'bcc_addrs' => array (
141 'name' => 'bcc_addrs',
142 'vname' => 'LBL_BCC',
144 'comment' => 'Email address(es) of person(s) to receive a blind carbon copy of the email',
149 'from_addr_name' => array (
150 'name' => 'from_addr_name',
152 'vname' => 'from_addr_name',
155 'reply_to_addr' => array (
156 'name' => 'reply_to_addr',
158 'vname' => 'reply_to_addr',
161 'to_addrs_names' => array (
162 'name' => 'to_addrs_names',
164 'vname' => 'to_addrs_names',
167 'cc_addrs_names' => array (
168 'name' => 'cc_addrs_names',
170 'vname' => 'cc_addrs_names',
173 'bcc_addrs_names' => array (
174 'name' => 'bcc_addrs_names',
176 'vname' => 'bcc_addrs_names',
179 'raw_source' => array (
180 'name' => 'raw_source',
182 'vname' => 'raw_source',
185 'description_html' => array (
186 'name' => 'description_html',
188 'vname' => 'description_html',
191 'description' => array (
192 'name' => 'description',
194 'vname' => 'description',
197 'date_sent' => array (
198 'name' => 'date_sent',
199 'vname' => 'LBL_DATE_SENT',
200 'type' => 'datetime',
201 'type' => 'datetime',
203 'message_id' => array (
204 'name' => 'message_id',
205 'vname' => 'LBL_MESSAGE_ID',
208 'comment' => 'ID of the email item obtained from the email transport system',
213 'vname' => 'LBL_SUBJECT',
217 'comment' => 'The subject of the email',
221 'vname' => 'LBL_LIST_TYPE',
223 'options' => 'dom_email_types',
226 'comment' => 'Type of email (ex: draft)',
230 'vname' => 'LBL_STATUS',
233 'options' => 'dom_email_status',
237 'vname' => 'LBL_EMAIL_FLAGGED',
241 'comment' => 'flagged status',
243 'reply_to_status' => array (
244 'name' => 'reply_to_status',
245 'vname' => 'LBL_EMAIL_REPLY_TO_STATUS',
249 'comment' => 'I you reply to an email then reply to status of original email is set',
253 'vname' => 'LBL_INTENT',
257 'comment' => 'Target of action used in Inbound Email assignment',
259 'mailbox_id' => array (
260 'name' => 'mailbox_id',
261 'vname' => 'LBL_MAILBOX_ID',
264 'reportable' => false,
266 'created_by_link' => array (
267 'name' => 'created_by_link',
269 'relationship' => 'emails_created_by',
270 'vname' => 'LBL_CREATED_BY_USER',
271 'link_type' => 'one',
273 'bean_name'=> 'User',
276 'modified_user_link' => array (
277 'name' => 'modified_user_link',
279 'relationship' => 'emails_modified_user',
280 'vname' => 'LBL_MODIFIED_BY_USER',
281 'link_type' => 'one',
283 'bean_name'=> 'User',
286 'assigned_user_link' => array (
287 'name' => 'assigned_user_link',
289 'relationship' => 'emails_assigned_user',
290 'vname' => 'LBL_ASSIGNED_TO_USER',
291 'link_type' => 'one',
293 'bean_name'=> 'User',
297 'parent_name' => array (
298 'name' => 'parent_name',
303 'parent_type' => array (
304 'name' => 'parent_type',
308 'comment' => 'Identifier of Sugar module to which this email is associated (deprecated as of 4.2)',
310 'parent_id' => array (
311 'name' => 'parent_id',
315 'comment' => 'ID of Sugar object referenced by parent_type (deprecated as of 4.2)',
318 /* relationship collection attributes */
319 /* added to support InboundEmail */
320 'accounts' => array (
321 'name' => 'accounts',
322 'vname' => 'LBL_EMAILS_ACCOUNTS_REL',
324 'relationship' => 'emails_accounts_rel',
325 'module' => 'Accounts',
326 'bean_name' => 'Account',
327 'source' => 'non-db',
331 'vname' => 'LBL_EMAILS_BUGS_REL',
333 'relationship' => 'emails_bugs_rel',
335 'bean_name' => 'Bug',
336 'source' => 'non-db',
340 'vname' => 'LBL_EMAILS_CASES_REL',
342 'relationship' => 'emails_cases_rel',
344 'bean_name' => 'Case',
345 'source' => 'non-db',
347 'contacts' => array (
348 'name' => 'contacts',
349 'vname' => 'LBL_EMAILS_CONTACTS_REL',
351 'relationship' => 'emails_contacts_rel',
352 'module' => 'Contacts',
353 'bean_name' => 'Contact',
354 'source' => 'non-db',
358 'vname' => 'LBL_EMAILS_LEADS_REL',
360 'relationship' => 'emails_leads_rel',
362 'bean_name' => 'Lead',
363 'source' => 'non-db',
365 'opportunities' => array (
366 'name' => 'opportunities',
367 'vname' => 'LBL_EMAILS_OPPORTUNITIES_REL',
369 'relationship' => 'emails_opportunities_rel',
370 'module' => 'Opportunities',
371 'bean_name' => 'Opportunity',
372 'source' => 'non-db',
376 'vname' => 'LBL_EMAILS_PROJECT_REL',
378 'relationship' => 'emails_projects_rel',
379 'module' => 'Project',
380 'bean_name' => 'Project',
381 'source' => 'non-db',
383 'projecttask'=> array(
384 'name' => 'projecttask',
385 'vname' => 'LBL_EMAILS_PROJECT_TASK_REL',
387 'relationship' => 'emails_project_task_rel',
388 'module' => 'ProjectTask',
389 'bean_name' => 'ProjectTask',
390 'source' => 'non-db',
393 'name' => 'prospects',
394 'vname' => 'LBL_EMAILS_PROSPECT_REL',
396 'relationship' => 'emails_prospects_rel',
397 'module' => 'Prospects',
398 'bean_name' => 'Prospect',
399 'source' => 'non-db',
405 'vname' => 'LBL_EMAILS_TASKS_REL',
407 'relationship' => 'emails_tasks_rel',
409 'bean_name' => 'Task',
410 'source' => 'non-db',
414 'vname' => 'LBL_EMAILS_USERS_REL',
416 'relationship' => 'emails_users_rel',
418 'bean_name' => 'User',
419 'source' => 'non-db',
423 'vname' => 'LBL_EMAILS_NOTES_REL',
425 'relationship' => 'emails_notes_rel',
427 'bean_name' => 'Note',
428 'source' => 'non-db',
430 /* end relationship collections */
432 ), /* end fields() array */
433 'relationships' => array(
434 'emails_assigned_user' => array(
435 'lhs_module' => 'Users',
436 'lhs_table' => 'users',
438 'rhs_module' => 'Emails',
439 'rhs_table' => 'emails',
440 'rhs_key' => 'assigned_user_id',
441 'relationship_type' => 'one-to-many'
443 'emails_modified_user' => array(
444 'lhs_module' => 'Users',
445 'lhs_table' => 'users',
447 'rhs_module' => 'Emails',
448 'rhs_table' => 'emails',
449 'rhs_key' => 'modified_user_id',
450 'relationship_type' => 'one-to-many'
452 'emails_created_by' => array(
453 'lhs_module' => 'Users',
454 'lhs_table' => 'users',
456 'rhs_module' => 'Emails',
457 'rhs_table' => 'emails',
458 'rhs_key' => 'created_by',
459 'relationship_type' => 'one-to-many'
461 'emails_notes_rel' => array(
462 'lhs_module' => 'Emails',
463 'lhs_table' => 'emails',
465 'rhs_module' => 'Notes',
466 'rhs_table' => 'notes',
467 'rhs_key' => 'parent_id',
468 'relationship_type' => 'one-to-many',
470 ), // end relationships
473 'name' => 'emailspk',
475 'fields' => array('id'),
478 'name' => 'idx_email_name',
480 'fields' => array('name')
483 'name' => 'idx_message_id',
485 'fields' => array('message_id')
488 'name' => 'idx_email_parent_id',
490 'fields' => array('parent_id')
493 'name' => 'idx_email_assigned',
495 'fields' => array('assigned_user_id', 'type','status')
500 VardefManager::createVardef('Emails','Email', array(