]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - metadata/emails_beansMetaData.php
Release 6.5.10
[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-2013 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                 ),
165                 'emails_leads_rel' => array(
166                         'lhs_module'            => 'Emails',
167                         'lhs_table'                     => 'emails',
168                         'lhs_key'                       => 'id',
169                         'rhs_module'            => 'Leads',
170                         'rhs_table'                     => 'leads',
171                         'rhs_key'                       => 'id',
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',
178                 ),
179                 'emails_opportunities_rel' => array(
180                         'lhs_module'            => 'Emails',
181                         'lhs_table'                     => 'emails',
182                         'lhs_key'                       => 'id',
183                         'rhs_module'            => 'Opportunities',
184                         'rhs_table'                     => 'opportunities',
185                         'rhs_key'                       => 'id',
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',
192                 ),
193                 'emails_tasks_rel' => array(
194                         'lhs_module'            => 'Emails',
195                         'lhs_table'                     => 'emails',
196                         'lhs_key'                       => 'id',
197                         'rhs_module'            => 'Tasks',
198                         'rhs_table'                     => 'tasks',
199                         'rhs_key'                       => 'id',
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',
206                 ),
207                 'emails_users_rel' => array(
208                         'lhs_module'            => 'Emails',
209                         'lhs_table'                     => 'emails',
210                         'lhs_key'                       => 'id',
211                         'rhs_module'            => 'Users',
212                         'rhs_table'                     => 'users',
213                         'rhs_key'                       => 'id',
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',
220                 ),
221                 'emails_project_task_rel' => array(
222                         'lhs_module'            => 'Emails',
223                         'lhs_table'                     => 'emails',
224                         'lhs_key'                       => 'id',
225                         'rhs_module'            => 'ProjectTask',
226                         'rhs_table'                     => 'project_task',
227                         'rhs_key'                       => 'id',
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',
234                 ),
235                 'emails_projects_rel' => array(
236                         'lhs_module'            => 'Emails',
237                         'lhs_table'                     => 'emails',
238                         'lhs_key'                       => 'id',
239                         'rhs_module'            => 'Project',
240                         'rhs_table'                     => 'project',
241                         'rhs_key'                       => 'id',
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',
248                 ),
249                 'emails_prospects_rel' => array(
250                         'lhs_module'            => 'Emails',
251                         'lhs_table'                     => 'emails',
252                         'lhs_key'                       => 'id',
253                         'rhs_module'            => 'Prospects',
254                         'rhs_table'                     => 'prospects',
255                         'rhs_key'                       => 'id',
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',
262                 ),
263                 'emails_quotes' => array(
264                         'lhs_module'            => 'Emails',
265                         'lhs_table'                     => 'emails',
266                         'lhs_key'                       => 'id',
267                         'rhs_module'            => 'Quotes',
268                         'rhs_table'                     => 'quotes',
269                         'rhs_key'                       => 'id',
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',
276                 ),
277         )
278 );
279
280
281 /**
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.
284  */
285 $dictionary['emails_text'] = array(
286         'table' => 'emails_text',
287         'comment' => 'Large email text fields',
288         'mysqlengine' => 'MyISAM',
289         'engine' => 'MyISAM',
290         'fields' => array(
291                 'email_id' => array (
292                         'name'                  => 'email_id',
293                         'vname'                 => 'LBL_ID',
294                         'type'                  => 'id',
295                         'dbType'                => 'id',
296                         'len'                   => 36,
297                         'required'              => true,
298                         'reportable'    => true,
299                         'comment'               => 'Foriegn key to emails table',
300                 ),
301                 'from_addr' => array (
302                         'name'                  => 'from_addr',
303                         'vname'                 => 'LBL_FROM',
304                         'type'                  => 'varchar',
305                         'len'                   => 255,
306                         'comment'               => 'Email address of person who send the email',
307                 ),
308                 'reply_to_addr' => array (
309                         'name'                  => 'reply_to_addr',
310                         'vname'                 => 'LBL_REPLY_TO',
311                         'type'                  => 'varchar',
312                         'len'                   => 255,
313                         'comment'               => 'reply to email address',
314                 ),
315                 'to_addrs' => array (
316                         'name'                  => 'to_addrs',
317                         'vname'                 => 'LBL_TO',
318                         'type'                  => 'text',
319                         'comment'               => 'Email address(es) of person(s) to receive the email',
320                 ),
321                 'cc_addrs' => array (
322                         'name'                  => 'cc_addrs',
323                         'vname'                 => 'LBL_CC',
324                         'type'                  => 'text',
325                         'comment'               => 'Email address(es) of person(s) to receive a carbon copy of the email',
326                 ),
327                 'bcc_addrs' => array (
328                         'name'                  => 'bcc_addrs',
329                         'vname'                 => 'LBL_BCC',
330                         'type'                  => 'text',
331                         'comment'               => 'Email address(es) of person(s) to receive a blind carbon copy of the email',
332                 ),
333                 'description' => array (
334                         'name'                  => 'description',
335                         'vname'                 => 'LBL_TEXT_BODY',
336                         'type'                  => 'longtext',
337             'reportable'        => false,
338                         'comment'               => 'Email body in plain text',
339                 ),
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',
346                 ),
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',
353         ),
354                 'deleted' => array(
355                         'name'                  => 'deleted',
356                         'type'                  => 'bool',
357                         'default'               => 0,
358                 ),
359         ),
360         'indices' => array(
361                 array(
362                         'name'                  => 'emails_textpk',
363                         'type'                  => 'primary',
364                         'fields'                => array('email_id')
365                 ),
366                 array(
367                         'name'                  => 'emails_textfromaddr',
368                         'type'                  => 'index',
369                         'fields'                => array('from_addr')
370                 ),
371         ),
372 );