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 ********************************************************************************/
38 /*********************************************************************************
41 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
42 * Reserved. Contributor(s): ______________________________________..
43 *********************************************************************************/
46 * Relationship table linking emails with 1 or more SugarBeans
48 $dictionary['emails_beans'] = array('table' => 'emails_beans',
61 'comment' => 'FK to emails table',
68 'comment' => 'FK to various beans\'s tables',
71 'name' => 'bean_module',
74 'comment' => 'bean\'s Module',
76 array( 'name' => 'campaign_data',
80 'name' => 'date_modified',
93 'name' => 'emails_beanspk',
95 'fields' => array('id')
98 'name' => 'idx_emails_beans_bean_id',
100 'fields' => array('bean_id')
103 'name' => 'idx_emails_beans_email_bean',
104 'type' => 'alternate_key',
105 'fields' => array('email_id', 'bean_id', 'deleted')
108 'relationships' => array(
109 'emails_accounts_rel' => array(
110 'lhs_module' => 'Emails',
111 'lhs_table' => 'emails',
113 'rhs_module' => 'Accounts',
114 'rhs_table' => 'accounts',
116 'relationship_type' => 'many-to-many',
117 'join_table' => 'emails_beans',
118 'join_key_lhs' => 'email_id',
119 'join_key_rhs' => 'bean_id',
120 'relationship_role_column' => 'bean_module',
121 'relationship_role_column_value' => 'Accounts',
123 'emails_bugs_rel' => array(
124 'lhs_module' => 'Emails',
125 'lhs_table' => 'emails',
127 'rhs_module' => 'Bugs',
128 'rhs_table' => 'bugs',
130 'relationship_type' => 'many-to-many',
131 'join_table' => 'emails_beans',
132 'join_key_lhs' => 'email_id',
133 'join_key_rhs' => 'bean_id',
134 'relationship_role_column' => 'bean_module',
135 'relationship_role_column_value' => 'Bugs',
137 'emails_cases_rel' => array(
138 'lhs_module' => 'Emails',
139 'lhs_table' => 'emails',
141 'rhs_module' => 'Cases',
142 'rhs_table' => 'cases',
144 'relationship_type' => 'many-to-many',
145 'join_table' => 'emails_beans',
146 'join_key_lhs' => 'email_id',
147 'join_key_rhs' => 'bean_id',
148 'relationship_role_column' => 'bean_module',
149 'relationship_role_column_value' => 'Cases',
151 'emails_contacts_rel' => array(
152 'lhs_module' => 'Emails',
153 'lhs_table' => 'emails',
155 'rhs_module' => 'Contacts',
156 'rhs_table' => 'contacts',
158 'relationship_type' => 'many-to-many',
159 'relationship_role_column' => 'bean_module',
160 'relationship_role_column_value' => 'Contacts',
161 'join_table' => 'emails_beans',
162 'join_key_lhs' => 'email_id',
163 'join_key_rhs' => 'bean_id',
165 'emails_leads_rel' => array(
166 'lhs_module' => 'Emails',
167 'lhs_table' => 'emails',
169 'rhs_module' => 'Leads',
170 'rhs_table' => 'leads',
172 'relationship_type' => 'many-to-many',
173 'join_table' => 'emails_beans',
174 'join_key_lhs' => 'email_id',
175 'join_key_rhs' => 'bean_id',
176 'relationship_role_column' => 'bean_module',
177 'relationship_role_column_value' => 'Leads',
179 'emails_opportunities_rel' => array(
180 'lhs_module' => 'Emails',
181 'lhs_table' => 'emails',
183 'rhs_module' => 'Opportunities',
184 'rhs_table' => 'opportunities',
186 'relationship_type' => 'many-to-many',
187 'join_table' => 'emails_beans',
188 'join_key_lhs' => 'email_id',
189 'join_key_rhs' => 'bean_id',
190 'relationship_role_column' => 'bean_module',
191 'relationship_role_column_value' => 'Opportunities',
193 'emails_tasks_rel' => array(
194 'lhs_module' => 'Emails',
195 'lhs_table' => 'emails',
197 'rhs_module' => 'Tasks',
198 'rhs_table' => 'tasks',
200 'relationship_type' => 'many-to-many',
201 'join_table' => 'emails_beans',
202 'join_key_lhs' => 'email_id',
203 'join_key_rhs' => 'bean_id',
204 'relationship_role_column' => 'bean_module',
205 'relationship_role_column_value' => 'Tasks',
207 'emails_users_rel' => array(
208 'lhs_module' => 'Emails',
209 'lhs_table' => 'emails',
211 'rhs_module' => 'Users',
212 'rhs_table' => 'users',
214 'relationship_type' => 'many-to-many',
215 'join_table' => 'emails_beans',
216 'join_key_lhs' => 'email_id',
217 'join_key_rhs' => 'bean_id',
218 'relationship_role_column' => 'bean_module',
219 'relationship_role_column_value' => 'Users',
221 'emails_project_task_rel' => array(
222 'lhs_module' => 'Emails',
223 'lhs_table' => 'emails',
225 'rhs_module' => 'ProjectTask',
226 'rhs_table' => 'project_task',
228 'relationship_type' => 'many-to-many',
229 'join_table' => 'emails_beans',
230 'join_key_lhs' => 'email_id',
231 'join_key_rhs' => 'bean_id',
232 'relationship_role_column' => 'bean_module',
233 'relationship_role_column_value' => 'ProjectTask',
235 'emails_projects_rel' => array(
236 'lhs_module' => 'Emails',
237 'lhs_table' => 'emails',
239 'rhs_module' => 'Project',
240 'rhs_table' => 'project',
242 'relationship_type' => 'many-to-many',
243 'join_table' => 'emails_beans',
244 'join_key_lhs' => 'email_id',
245 'join_key_rhs' => 'bean_id',
246 'relationship_role_column' => 'bean_module',
247 'relationship_role_column_value' => 'Project',
249 'emails_prospects_rel' => array(
250 'lhs_module' => 'Emails',
251 'lhs_table' => 'emails',
253 'rhs_module' => 'Prospects',
254 'rhs_table' => 'prospects',
256 'relationship_type' => 'many-to-many',
257 'join_table' => 'emails_beans',
258 'join_key_lhs' => 'email_id',
259 'join_key_rhs' => 'bean_id',
260 'relationship_role_column' => 'bean_module',
261 'relationship_role_column_value' => 'Prospects',
263 'emails_quotes' => array(
264 'lhs_module' => 'Emails',
265 'lhs_table' => 'emails',
267 'rhs_module' => 'Quotes',
268 'rhs_table' => 'quotes',
270 'relationship_type' => 'many-to-many',
271 'join_table' => 'emails_beans',
272 'join_key_lhs' => 'email_id',
273 'join_key_rhs' => 'bean_id',
274 'relationship_role_column' => 'bean_module',
275 'relationship_role_column_value' => 'Quotes',
282 * Large text field table, shares a 1:1 with the emails table. Moving all longtext fields to this table allows more
283 * effiencient email management and full-text search capabilities.
285 $dictionary['emails_text'] = array(
286 'table' => 'emails_text',
287 'comment' => 'Large email text fields',
288 'mysqlengine' => 'MyISAM',
289 'engine' => 'MyISAM',
291 'email_id' => array (
292 'name' => 'email_id',
298 'reportable' => true,
299 'comment' => 'Foriegn key to emails table',
301 'from_addr' => array (
302 'name' => 'from_addr',
303 'vname' => 'LBL_FROM',
306 'comment' => 'Email address of person who send the email',
308 'reply_to_addr' => array (
309 'name' => 'reply_to_addr',
310 'vname' => 'LBL_REPLY_TO',
313 'comment' => 'reply to email address',
315 'to_addrs' => array (
316 'name' => 'to_addrs',
319 'comment' => 'Email address(es) of person(s) to receive the email',
321 'cc_addrs' => array (
322 'name' => 'cc_addrs',
325 'comment' => 'Email address(es) of person(s) to receive a carbon copy of the email',
327 'bcc_addrs' => array (
328 'name' => 'bcc_addrs',
329 'vname' => 'LBL_BCC',
331 'comment' => 'Email address(es) of person(s) to receive a blind carbon copy of the email',
333 'description' => array (
334 'name' => 'description',
335 'vname' => 'LBL_TEXT_BODY',
336 'type' => 'longtext',
337 'reportable' => false,
338 'comment' => 'Email body in plain text',
340 'description_html' => array (
341 'name' => 'description_html',
342 'vname' => 'LBL_HTML_BODY',
343 'type' => 'longhtml',
344 'reportable' => false,
345 'comment' => 'Email body in HTML format',
347 'raw_source' => array (
348 'name' => 'raw_source',
349 'vname' => 'LBL_RAW',
350 'type' => 'longtext',
351 'reportable' => false,
352 'comment' => 'Full raw source of email',
362 'name' => 'emails_textpk',
364 'fields' => array('email_id')
367 'name' => 'emails_textfromaddr',
369 'fields' => array('from_addr')