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.
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',
164 'relationship_role_column' => 'bean_module',
165 'relationship_role_column_value' => 'Contacts',
167 'emails_leads_rel' => array(
168 'lhs_module' => 'Emails',
169 'lhs_table' => 'emails',
171 'rhs_module' => 'Leads',
172 'rhs_table' => 'leads',
174 'relationship_type' => 'many-to-many',
175 'join_table' => 'emails_beans',
176 'join_key_lhs' => 'email_id',
177 'join_key_rhs' => 'bean_id',
178 'relationship_role_column' => 'bean_module',
179 'relationship_role_column_value' => 'Leads',
181 'emails_opportunities_rel' => array(
182 'lhs_module' => 'Emails',
183 'lhs_table' => 'emails',
185 'rhs_module' => 'Opportunities',
186 'rhs_table' => 'opportunities',
188 'relationship_type' => 'many-to-many',
189 'join_table' => 'emails_beans',
190 'join_key_lhs' => 'email_id',
191 'join_key_rhs' => 'bean_id',
192 'relationship_role_column' => 'bean_module',
193 'relationship_role_column_value' => 'Opportunities',
195 'emails_tasks_rel' => array(
196 'lhs_module' => 'Emails',
197 'lhs_table' => 'emails',
199 'rhs_module' => 'Tasks',
200 'rhs_table' => 'tasks',
202 'relationship_type' => 'many-to-many',
203 'join_table' => 'emails_beans',
204 'join_key_lhs' => 'email_id',
205 'join_key_rhs' => 'bean_id',
206 'relationship_role_column' => 'bean_module',
207 'relationship_role_column_value' => 'Tasks',
209 'emails_users_rel' => array(
210 'lhs_module' => 'Emails',
211 'lhs_table' => 'emails',
213 'rhs_module' => 'Users',
214 'rhs_table' => 'users',
216 'relationship_type' => 'many-to-many',
217 'join_table' => 'emails_beans',
218 'join_key_lhs' => 'email_id',
219 'join_key_rhs' => 'bean_id',
220 'relationship_role_column' => 'bean_module',
221 'relationship_role_column_value' => 'Users',
223 'emails_project_task_rel' => array(
224 'lhs_module' => 'Emails',
225 'lhs_table' => 'emails',
227 'rhs_module' => 'ProjectTask',
228 'rhs_table' => 'project_task',
230 'relationship_type' => 'many-to-many',
231 'join_table' => 'emails_beans',
232 'join_key_lhs' => 'email_id',
233 'join_key_rhs' => 'bean_id',
234 'relationship_role_column' => 'bean_module',
235 'relationship_role_column_value' => 'ProjectTask',
237 'emails_projects_rel' => array(
238 'lhs_module' => 'Emails',
239 'lhs_table' => 'emails',
241 'rhs_module' => 'Project',
242 'rhs_table' => 'project',
244 'relationship_type' => 'many-to-many',
245 'join_table' => 'emails_beans',
246 'join_key_lhs' => 'email_id',
247 'join_key_rhs' => 'bean_id',
248 'relationship_role_column' => 'bean_module',
249 'relationship_role_column_value' => 'Project',
251 'emails_prospects_rel' => array(
252 'lhs_module' => 'Emails',
253 'lhs_table' => 'emails',
255 'rhs_module' => 'Prospects',
256 'rhs_table' => 'prospects',
258 'relationship_type' => 'many-to-many',
259 'join_table' => 'emails_beans',
260 'join_key_lhs' => 'email_id',
261 'join_key_rhs' => 'bean_id',
262 'relationship_role_column' => 'bean_module',
263 'relationship_role_column_value' => 'Prospects',
265 'emails_quotes' => array(
266 'lhs_module' => 'Emails',
267 'lhs_table' => 'emails',
269 'rhs_module' => 'Quotes',
270 'rhs_table' => 'quotes',
272 'relationship_type' => 'many-to-many',
273 'join_table' => 'emails_beans',
274 'join_key_lhs' => 'email_id',
275 'join_key_rhs' => 'bean_id',
276 'relationship_role_column' => 'bean_module',
277 'relationship_role_column_value' => 'Quotes',
284 * Large text field table, shares a 1:1 with the emails table. Moving all longtext fields to this table allows more
285 * effiencient email management and full-text search capabilities.
287 $dictionary['emails_text'] = array(
288 'table' => 'emails_text',
289 'comment' => 'Large email text fields',
290 'mysqlengine' => 'MyISAM',
291 'engine' => 'MyISAM',
293 'email_id' => array (
294 'name' => 'email_id',
300 'reportable' => true,
301 'comment' => 'Foriegn key to emails table',
303 'from_addr' => array (
304 'name' => 'from_addr',
305 'vname' => 'LBL_FROM',
308 'comment' => 'Email address of person who send the email',
310 'reply_to_addr' => array (
311 'name' => 'reply_to_addr',
312 'vname' => 'LBL_REPLY_TO',
315 'comment' => 'reply to email address',
317 'to_addrs' => array (
318 'name' => 'to_addrs',
321 'comment' => 'Email address(es) of person(s) to receive the email',
323 'cc_addrs' => array (
324 'name' => 'cc_addrs',
327 'comment' => 'Email address(es) of person(s) to receive a carbon copy of the email',
329 'bcc_addrs' => array (
330 'name' => 'bcc_addrs',
331 'vname' => 'LBL_BCC',
333 'comment' => 'Email address(es) of person(s) to receive a blind carbon copy of the email',
335 'description' => array (
336 'name' => 'description',
337 'vname' => 'LBL_TEXT_BODY',
338 'type' => 'longtext',
339 'reportable' => false,
340 'comment' => 'Email body in plain text',
342 'description_html' => array (
343 'name' => 'description_html',
344 'vname' => 'LBL_HTML_BODY',
345 'type' => 'longtext',
346 'reportable' => false,
347 'comment' => 'Email body in HTML format',
349 'raw_source' => array (
350 'name' => 'raw_source',
351 'vname' => 'LBL_RAW',
352 'type' => 'longtext',
353 'reportable' => false,
354 'comment' => 'Full raw source of email',
364 'name' => 'emails_textpk',
366 'fields' => array('email_id')
369 'name' => 'emails_textfromaddr',
371 'fields' => array('from_addr')