]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - metadata/emails_beansMetaData.php
Release 6.4.0
[Github/sugarcrm.git] / metadata / emails_beansMetaData.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-2011 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 /*********************************************************************************
39
40  * Description:
41  * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
42  * Reserved. Contributor(s): ______________________________________..
43  *********************************************************************************/
44
45 /**
46  * Relationship table linking emails with 1 or more SugarBeans
47  */
48 $dictionary['emails_beans'] = array('table' => 'emails_beans',
49         'fields' => array(
50                 array(
51                         'name'          => 'id',
52                         'type'          => 'varchar',
53                         'dbType'        => 'id',
54                         'len'           => '36'
55                 ),
56                 array(
57                         'name'          => 'email_id',
58                         'type'          => 'varchar',
59                         'dbType'        => 'id',
60                         'len'           => '36',
61                         'comment'       => 'FK to emails table',
62                 ),
63                 array(
64                         'name'          => 'bean_id',
65                         'dbType'        => 'id',
66                         'type'          => 'varchar',
67                         'len'           => '36',
68                         'comment'       => 'FK to various beans\'s tables',
69                 ),
70                 array(
71                         'name'          => 'bean_module',
72                         'type'          => 'varchar',
73                         'len'           => '100',
74                         'comment'       => 'bean\'s Module',
75                 ),
76         array(  'name'      => 'campaign_data',
77                 'type'      => 'text',
78         ),
79                 array(
80                         'name'          => 'date_modified',
81                         'type'          =>      'datetime'
82                 ),
83                 array(
84                         'name'          => 'deleted',
85                         'type'          => 'bool',
86                         'len'           => '1',
87                         'default'       => '0',
88                         'required'      => false
89                 )
90         ),
91         'indices' => array(
92                 array(
93                         'name'          => 'emails_beanspk',
94                         'type'          => 'primary',
95                         'fields'        => array('id')
96                 ),
97                 array(
98                         'name'          => 'idx_emails_beans_bean_id',
99                         'type'          => 'index',
100                         'fields'        => array('bean_id')
101                 ),
102                 array(
103                         'name'          => 'idx_emails_beans_email_bean',
104                         'type'          => 'alternate_key',
105                         'fields'        => array('email_id', 'bean_id', 'deleted')
106                 ),
107         ),
108         'relationships' => array(
109                 'emails_accounts_rel' => array(
110                         'lhs_module'            => 'Emails',
111                         'lhs_table'                     => 'emails',
112                         'lhs_key'                       => 'id',
113                         'rhs_module'            => 'Accounts',
114                         'rhs_table'                     => 'accounts',
115                         'rhs_key'                       => 'id',
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',
122                 ),
123                 'emails_bugs_rel' => array(
124                         'lhs_module'            => 'Emails',
125                         'lhs_table'                     => 'emails',
126                         'lhs_key'                       => 'id',
127                         'rhs_module'            => 'Bugs',
128                         'rhs_table'                     => 'bugs',
129                         'rhs_key'                       => 'id',
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',
136                 ),
137                 'emails_cases_rel' => array(
138                         'lhs_module'            => 'Emails',
139                         'lhs_table'                     => 'emails',
140                         'lhs_key'                       => 'id',
141                         'rhs_module'            => 'Cases',
142                         'rhs_table'                     => 'cases',
143                         'rhs_key'                       => 'id',
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',
150                 ),
151                 'emails_contacts_rel'   => array(
152                         'lhs_module'            => 'Emails',
153                         'lhs_table'                     => 'emails',
154                         'lhs_key'                       => 'id',
155                         'rhs_module'            => 'Contacts',
156                         'rhs_table'                     => 'contacts',
157                         'rhs_key'                       => 'id',
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',
166                 ),
167                 'emails_leads_rel' => array(
168                         'lhs_module'            => 'Emails',
169                         'lhs_table'                     => 'emails',
170                         'lhs_key'                       => 'id',
171                         'rhs_module'            => 'Leads',
172                         'rhs_table'                     => 'leads',
173                         'rhs_key'                       => 'id',
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',
180                 ),
181                 'emails_opportunities_rel' => array(
182                         'lhs_module'            => 'Emails',
183                         'lhs_table'                     => 'emails',
184                         'lhs_key'                       => 'id',
185                         'rhs_module'            => 'Opportunities',
186                         'rhs_table'                     => 'opportunities',
187                         'rhs_key'                       => 'id',
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',
194                 ),
195                 'emails_tasks_rel' => array(
196                         'lhs_module'            => 'Emails',
197                         'lhs_table'                     => 'emails',
198                         'lhs_key'                       => 'id',
199                         'rhs_module'            => 'Tasks',
200                         'rhs_table'                     => 'tasks',
201                         'rhs_key'                       => 'id',
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',
208                 ),
209                 'emails_users_rel' => array(
210                         'lhs_module'            => 'Emails',
211                         'lhs_table'                     => 'emails',
212                         'lhs_key'                       => 'id',
213                         'rhs_module'            => 'Users',
214                         'rhs_table'                     => 'users',
215                         'rhs_key'                       => 'id',
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',
222                 ),
223                 'emails_project_task_rel' => array(
224                         'lhs_module'            => 'Emails',
225                         'lhs_table'                     => 'emails',
226                         'lhs_key'                       => 'id',
227                         'rhs_module'            => 'ProjectTask',
228                         'rhs_table'                     => 'project_task',
229                         'rhs_key'                       => 'id',
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',
236                 ),
237                 'emails_projects_rel' => array(
238                         'lhs_module'            => 'Emails',
239                         'lhs_table'                     => 'emails',
240                         'lhs_key'                       => 'id',
241                         'rhs_module'            => 'Project',
242                         'rhs_table'                     => 'project',
243                         'rhs_key'                       => 'id',
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',
250                 ),
251                 'emails_prospects_rel' => array(
252                         'lhs_module'            => 'Emails',
253                         'lhs_table'                     => 'emails',
254                         'lhs_key'                       => 'id',
255                         'rhs_module'            => 'Prospects',
256                         'rhs_table'                     => 'prospects',
257                         'rhs_key'                       => 'id',
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',
264                 ),
265                 'emails_quotes' => array(
266                         'lhs_module'            => 'Emails',
267                         'lhs_table'                     => 'emails',
268                         'lhs_key'                       => 'id',
269                         'rhs_module'            => 'Quotes',
270                         'rhs_table'                     => 'quotes',
271                         'rhs_key'                       => 'id',
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',
278                 ),
279         )
280 );
281
282
283 /**
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.
286  */
287 $dictionary['emails_text'] = array(
288         'table' => 'emails_text',
289         'comment' => 'Large email text fields',
290         'mysqlengine' => 'MyISAM',
291         'engine' => 'MyISAM',
292         'fields' => array(
293                 'email_id' => array (
294                         'name'                  => 'email_id',
295                         'vname'                 => 'LBL_ID',
296                         'type'                  => 'id',
297                         'dbType'                => 'id',
298                         'len'                   => 36,
299                         'required'              => true,
300                         'reportable'    => true,
301                         'comment'               => 'Foriegn key to emails table',
302                 ),
303                 'from_addr' => array (
304                         'name'                  => 'from_addr',
305                         'vname'                 => 'LBL_FROM',
306                         'type'                  => 'varchar',
307                         'len'                   => 255,
308                         'comment'               => 'Email address of person who send the email',
309                 ),
310                 'reply_to_addr' => array (
311                         'name'                  => 'reply_to_addr',
312                         'vname'                 => 'LBL_REPLY_TO',
313                         'type'                  => 'varchar',
314                         'len'                   => 255,
315                         'comment'               => 'reply to email address',
316                 ),
317                 'to_addrs' => array (
318                         'name'                  => 'to_addrs',
319                         'vname'                 => 'LBL_TO',
320                         'type'                  => 'text',
321                         'comment'               => 'Email address(es) of person(s) to receive the email',
322                 ),
323                 'cc_addrs' => array (
324                         'name'                  => 'cc_addrs',
325                         'vname'                 => 'LBL_CC',
326                         'type'                  => 'text',
327                         'comment'               => 'Email address(es) of person(s) to receive a carbon copy of the email',
328                 ),
329                 'bcc_addrs' => array (
330                         'name'                  => 'bcc_addrs',
331                         'vname'                 => 'LBL_BCC',
332                         'type'                  => 'text',
333                         'comment'               => 'Email address(es) of person(s) to receive a blind carbon copy of the email',
334                 ),
335                 'description' => array (
336                         'name'                  => 'description',
337                         'vname'                 => 'LBL_TEXT_BODY',
338                         'type'                  => 'longtext',
339             'reportable'        => false,
340                         'comment'               => 'Email body in plain text',
341                 ),
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',
348                 ),
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',
355         ),
356                 'deleted' => array(
357                         'name'                  => 'deleted',
358                         'type'                  => 'bool',
359                         'default'               => 0,
360                 ),
361         ),
362         'indices' => array(
363                 array(
364                         'name'                  => 'emails_textpk',
365                         'type'                  => 'primary',
366                         'fields'                => array('email_id')
367                 ),
368                 array(
369                         'name'                  => 'emails_textfromaddr',
370                         'type'                  => 'index',
371                         'fields'                => array('from_addr')
372                 ),
373         ),
374 );