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-2013 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',
215 'dbType' => 'varchar',
218 'comment' => 'The subject of the email',
222 'vname' => 'LBL_LIST_TYPE',
224 'options' => 'dom_email_types',
227 'comment' => 'Type of email (ex: draft)',
231 'vname' => 'LBL_STATUS',
234 'options' => 'dom_email_status',
238 'vname' => 'LBL_EMAIL_FLAGGED',
242 'comment' => 'flagged status',
244 'reply_to_status' => array (
245 'name' => 'reply_to_status',
246 'vname' => 'LBL_EMAIL_REPLY_TO_STATUS',
250 'comment' => 'I you reply to an email then reply to status of original email is set',
254 'vname' => 'LBL_INTENT',
258 'comment' => 'Target of action used in Inbound Email assignment',
260 'mailbox_id' => array (
261 'name' => 'mailbox_id',
262 'vname' => 'LBL_MAILBOX_ID',
265 'reportable' => false,
267 'created_by_link' => array (
268 'name' => 'created_by_link',
270 'relationship' => 'emails_created_by',
271 'vname' => 'LBL_CREATED_BY_USER',
272 'link_type' => 'one',
274 'bean_name'=> 'User',
277 'modified_user_link' => array (
278 'name' => 'modified_user_link',
280 'relationship' => 'emails_modified_user',
281 'vname' => 'LBL_MODIFIED_BY_USER',
282 'link_type' => 'one',
284 'bean_name'=> 'User',
287 'assigned_user_link' => array (
288 'name' => 'assigned_user_link',
290 'relationship' => 'emails_assigned_user',
291 'vname' => 'LBL_ASSIGNED_TO_USER',
292 'link_type' => 'one',
294 'bean_name'=> 'User',
298 'parent_name' => array (
299 'name' => 'parent_name',
304 'parent_type' => array (
305 'name' => 'parent_type',
309 'comment' => 'Identifier of Sugar module to which this email is associated (deprecated as of 4.2)',
311 'parent_id' => array (
312 'name' => 'parent_id',
316 'comment' => 'ID of Sugar object referenced by parent_type (deprecated as of 4.2)',
319 /* relationship collection attributes */
320 /* added to support InboundEmail */
321 'accounts' => array (
322 'name' => 'accounts',
323 'vname' => 'LBL_EMAILS_ACCOUNTS_REL',
325 'relationship' => 'emails_accounts_rel',
326 'module' => 'Accounts',
327 'bean_name' => 'Account',
328 'source' => 'non-db',
332 'vname' => 'LBL_EMAILS_BUGS_REL',
334 'relationship' => 'emails_bugs_rel',
336 'bean_name' => 'Bug',
337 'source' => 'non-db',
341 'vname' => 'LBL_EMAILS_CASES_REL',
343 'relationship' => 'emails_cases_rel',
345 'bean_name' => 'Case',
346 'source' => 'non-db',
348 'contacts' => array (
349 'name' => 'contacts',
350 'vname' => 'LBL_EMAILS_CONTACTS_REL',
352 'relationship' => 'emails_contacts_rel',
353 'module' => 'Contacts',
354 'bean_name' => 'Contact',
355 'source' => 'non-db',
359 'vname' => 'LBL_EMAILS_LEADS_REL',
361 'relationship' => 'emails_leads_rel',
363 'bean_name' => 'Lead',
364 'source' => 'non-db',
366 'opportunities' => array (
367 'name' => 'opportunities',
368 'vname' => 'LBL_EMAILS_OPPORTUNITIES_REL',
370 'relationship' => 'emails_opportunities_rel',
371 'module' => 'Opportunities',
372 'bean_name' => 'Opportunity',
373 'source' => 'non-db',
377 'vname' => 'LBL_EMAILS_PROJECT_REL',
379 'relationship' => 'emails_projects_rel',
380 'module' => 'Project',
381 'bean_name' => 'Project',
382 'source' => 'non-db',
384 'projecttask'=> array(
385 'name' => 'projecttask',
386 'vname' => 'LBL_EMAILS_PROJECT_TASK_REL',
388 'relationship' => 'emails_project_task_rel',
389 'module' => 'ProjectTask',
390 'bean_name' => 'ProjectTask',
391 'source' => 'non-db',
394 'name' => 'prospects',
395 'vname' => 'LBL_EMAILS_PROSPECT_REL',
397 'relationship' => 'emails_prospects_rel',
398 'module' => 'Prospects',
399 'bean_name' => 'Prospect',
400 'source' => 'non-db',
406 'vname' => 'LBL_EMAILS_TASKS_REL',
408 'relationship' => 'emails_tasks_rel',
410 'bean_name' => 'Task',
411 'source' => 'non-db',
415 'vname' => 'LBL_EMAILS_USERS_REL',
417 'relationship' => 'emails_users_rel',
419 'bean_name' => 'User',
420 'source' => 'non-db',
424 'vname' => 'LBL_EMAILS_NOTES_REL',
426 'relationship' => 'emails_notes_rel',
428 'bean_name' => 'Note',
429 'source' => 'non-db',
433 'name' => 'meetings',
434 'vname' => 'LBL_EMAILS_MEETINGS_REL',
436 'relationship' => 'emails_meetings_rel',
437 'module' => 'Meetings',
438 'bean_name' => 'Meeting',
439 'source' => 'non-db',
441 /* end relationship collections */
443 ), /* end fields() array */
444 'relationships' => array(
445 'emails_assigned_user' => array(
446 'lhs_module' => 'Users',
447 'lhs_table' => 'users',
449 'rhs_module' => 'Emails',
450 'rhs_table' => 'emails',
451 'rhs_key' => 'assigned_user_id',
452 'relationship_type' => 'one-to-many'
454 'emails_modified_user' => array(
455 'lhs_module' => 'Users',
456 'lhs_table' => 'users',
458 'rhs_module' => 'Emails',
459 'rhs_table' => 'emails',
460 'rhs_key' => 'modified_user_id',
461 'relationship_type' => 'one-to-many'
463 'emails_created_by' => array(
464 'lhs_module' => 'Users',
465 'lhs_table' => 'users',
467 'rhs_module' => 'Emails',
468 'rhs_table' => 'emails',
469 'rhs_key' => 'created_by',
470 'relationship_type' => 'one-to-many'
472 'emails_notes_rel' => array(
473 'lhs_module' => 'Emails',
474 'lhs_table' => 'emails',
476 'rhs_module' => 'Notes',
477 'rhs_table' => 'notes',
478 'rhs_key' => 'parent_id',
479 'relationship_type' => 'one-to-many',
481 'emails_contacts_rel' => array(
482 'lhs_module' => 'Emails',
483 'lhs_table' => 'emails',
485 'rhs_module' => 'Contacts',
486 'rhs_table' => 'contacts',
488 'relationship_type' => 'many-to-many',
489 'join_table' => 'emails_beans',
490 'join_key_lhs' => 'email_id',
491 'join_key_rhs' => 'bean_id',
492 'relationship_role_column' => 'bean_module',
493 'relationship_role_column_value' => 'Contacts',
495 'emails_accounts_rel' => array(
496 'lhs_module' => 'Emails',
497 'lhs_table' => 'emails',
499 'rhs_module' => 'Accounts',
500 'rhs_table' => 'accounts',
502 'relationship_type' => 'many-to-many',
503 'join_table' => 'emails_beans',
504 'join_key_lhs' => 'email_id',
505 'join_key_rhs' => 'bean_id',
506 'relationship_role_column' => 'bean_module',
507 'relationship_role_column_value' => 'Accounts',
509 'emails_leads_rel' => array(
510 'lhs_module' => 'Emails',
511 'lhs_table' => 'emails',
513 'rhs_module' => 'Leads',
514 'rhs_table' => 'leads',
516 'relationship_type' => 'many-to-many',
517 'join_table' => 'emails_beans',
518 'join_key_lhs' => 'email_id',
519 'join_key_rhs' => 'bean_id',
520 'relationship_role_column' => 'bean_module',
521 'relationship_role_column_value' => 'Leads',
524 'emails_meetings_rel' => array(
525 'lhs_module' => 'Emails',
526 'lhs_table' => 'emails',
528 'rhs_module' => 'Meetings',
529 'rhs_table' => 'meetings',
530 'rhs_key' => 'parent_id',
531 'relationship_type' => 'one-to-many',
533 ), // end relationships
536 'name' => 'emailspk',
538 'fields' => array('id'),
541 'name' => 'idx_email_name',
543 'fields' => array('name')
546 'name' => 'idx_message_id',
548 'fields' => array('message_id')
551 'name' => 'idx_email_parent_id',
553 'fields' => array('parent_id')
556 'name' => 'idx_email_assigned',
558 'fields' => array('assigned_user_id', 'type','status')
563 VardefManager::createVardef('Emails','Email', array(