]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Emails/vardefs.php
Release 6.5.10
[Github/sugarcrm.git] / modules / Emails / vardefs.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 $dictionary['Email'] = array(
40     'table' => 'emails',
41     'acl_fields'=>false,
42     'comment' => 'Contains a record of emails sent to and from the Sugar application',
43         'fields' => array (
44                 'id' => array (
45                         'name' => 'id',
46                         'vname' => 'LBL_ID',
47                         'type' => 'id',
48                         'required' => true,
49                         'reportable'=>true,
50                         'comment' => 'Unique identifier',
51                 ),
52                 'date_entered' => array (
53                         'name' => 'date_entered',
54                         'vname' => 'LBL_DATE_ENTERED',
55                         'type' => 'datetime',
56                         'required'=>true,
57                         'comment' => 'Date record created',
58                 ),
59                 'date_modified' => array (
60                         'name' => 'date_modified',
61                         'vname' => 'LBL_DATE_MODIFIED',
62                         'type' => 'datetime',
63                         'required'=>true,
64                         'comment' => 'Date record last modified',
65                 ),
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',
72                         'table' => 'users',
73                         'isnull' => 'false',
74                         'reportable'=>true,
75                         'dbType' => 'id',
76                         'comment' => 'User ID that last modified record',
77                 ),
78                 'assigned_user_name' => array (
79                         'name' => 'assigned_user_name',
80                         'vname' => 'LBL_ASSIGNED_TO',
81                         'type' => 'varchar',
82                         'reportable'=>false,
83                         'source'=> 'non-db',
84                         'table' => 'users',
85                 ),
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',
92                         'table' => 'users',
93                         'isnull' => 'false',
94                         'reportable'=>true,
95                         'dbType' => 'id',
96                         'comment' => 'User ID that last modified record',
97                 ),
98                 'created_by' => array (
99                         'name' => 'created_by',
100                         'vname' => 'LBL_CREATED_BY',
101                         'type' => 'id',
102                         'len'=> '36',
103                         'reportable' => false,
104                         'comment' => 'User name who created record',
105                 ),
106                 'deleted' => array (
107                         'name' => 'deleted',
108                         'vname' => 'LBL_DELETED',
109                         'type' => 'bool',
110                         'required' => false,
111                         'reportable'=>false,
112                         'comment' => 'Record deletion indicator',
113                 ),
114 /**
115  * DEPRECATED FOR 5.0
116                 'from_addr' => array (
117                         'name' => 'from_addr',
118                         'vname' => 'LBL_FROM',
119                         'type' => 'id',
120                         'comment' => 'Email address of the person sending the email',
121                 ),
122                 'reply_to_addr' => array (
123                         'name' => 'reply_to_addr',
124                         'vname' => 'LBL_REPLY_TO_ADDRESS',
125                         'type' => 'id',
126                         'comment' => 'Email address of person indicated in the Reply-to email field',
127                 ),
128                 'to_addrs' => array (
129                         'name' => 'to_addrs',
130                         'vname' => 'LBL_TO',
131                         'type' => 'id',
132                         'comment' => 'Email address(es) of person(s) to receive the email',
133                 ),
134                 'cc_addrs' => array (
135                         'name' => 'cc_addrs',
136                         'vname' => 'LBL_CC',
137                         'type' => 'id',
138                         'comment' => 'Email address(es) of person(s) to receive a carbon copy of the email',
139                 ),
140                 'bcc_addrs' => array (
141                         'name' => 'bcc_addrs',
142                         'vname' => 'LBL_BCC',
143                         'type' => 'id',
144                         'comment' => 'Email address(es) of person(s) to receive a blind carbon copy of the email',
145                 ),
146 */
147
148
149                 'from_addr_name' => array (
150                         'name' => 'from_addr_name',
151                         'type' => 'varchar',
152                         'vname' => 'from_addr_name',
153                         'source'=> 'non-db',
154                 ),
155                 'reply_to_addr' => array (
156                         'name' => 'reply_to_addr',
157                         'type' => 'varchar',
158                         'vname' => 'reply_to_addr',
159                         'source'=> 'non-db',
160                 ),
161                 'to_addrs_names' => array (
162                         'name' => 'to_addrs_names',
163                         'type' => 'varchar',
164                         'vname' => 'to_addrs_names',
165                         'source'=> 'non-db',
166                 ),
167                 'cc_addrs_names' => array (
168                         'name' => 'cc_addrs_names',
169                         'type' => 'varchar',
170                         'vname' => 'cc_addrs_names',
171                         'source'=> 'non-db',
172                 ),
173                 'bcc_addrs_names' => array (
174                         'name' => 'bcc_addrs_names',
175                         'type' => 'varchar',
176                         'vname' => 'bcc_addrs_names',
177                         'source'=> 'non-db',
178                 ),
179                 'raw_source' => array (
180                         'name' => 'raw_source',
181                         'type' => 'varchar',
182                         'vname' => 'raw_source',
183                         'source'=> 'non-db',
184                 ),
185                 'description_html' => array (
186                         'name' => 'description_html',
187                         'type' => 'varchar',
188                         'vname' => 'description_html',
189                         'source'=> 'non-db',
190                 ),
191                 'description' => array (
192                         'name' => 'description',
193                         'type' => 'varchar',
194                         'vname' => 'description',
195                         'source'=> 'non-db',
196                 ),
197                 'date_sent' => array (
198                         'name'                  => 'date_sent',
199                         'vname'                 => 'LBL_DATE_SENT',
200                         'type'                  => 'datetime',
201                         'type'                  => 'datetime',
202                 ),
203                 'message_id' => array (
204                         'name'          => 'message_id',
205                         'vname'         => 'LBL_MESSAGE_ID',
206                         'type'          => 'varchar',
207                         'len'           => 255,
208                         'comment' => 'ID of the email item obtained from the email transport system',
209                 ),
210
211                 'name' => array (
212                         'name' => 'name',
213                         'vname' => 'LBL_SUBJECT',
214                         'type' => 'name',
215                         'dbType' => 'varchar',
216                         'required' => false,
217                         'len' => '255',
218                         'comment' => 'The subject of the email',
219                 ),
220                 'type' => array (
221                         'name' => 'type',
222                         'vname' => 'LBL_LIST_TYPE',
223                         'type' => 'enum',
224                         'options' => 'dom_email_types',
225                         'len' => 100,
226                         'massupdate'=>false,
227                         'comment' => 'Type of email (ex: draft)',
228                 ),
229                 'status' => array (
230                         'name' => 'status',
231                         'vname' => 'LBL_STATUS',
232                         'type' => 'enum',
233                         'len' => 100,
234                         'options' => 'dom_email_status',
235                 ),
236                 'flagged' => array (
237                         'name' => 'flagged',
238                         'vname' => 'LBL_EMAIL_FLAGGED',
239                         'type' => 'bool',
240                         'required' => false,
241                         'reportable'=>false,
242                         'comment' => 'flagged status',
243                 ),
244                 'reply_to_status' => array (
245                         'name' => 'reply_to_status',
246                         'vname' => 'LBL_EMAIL_REPLY_TO_STATUS',
247                         'type' => 'bool',
248                         'required' => false,
249                         'reportable'=>false,
250                         'comment' => 'I you reply to an email then reply to status of original email is set',
251                 ),
252                 'intent' => array (
253                         'name'  => 'intent',
254                         'vname' => 'LBL_INTENT',
255                         'type'  => 'varchar',
256                         'len' => 100,
257                         'default'       => 'pick',
258                         'comment' => 'Target of action used in Inbound Email assignment',
259                 ),
260                 'mailbox_id' => array (
261                         'name' => 'mailbox_id',
262                         'vname' => 'LBL_MAILBOX_ID',
263                         'type' => 'id',
264                         'len'=> '36',
265                         'reportable' => false,
266                 ),
267                 'created_by_link' => array (
268                         'name' => 'created_by_link',
269                         'type' => 'link',
270                         'relationship' => 'emails_created_by',
271                         'vname' => 'LBL_CREATED_BY_USER',
272                         'link_type' => 'one',
273                         'module'=> 'Users',
274                         'bean_name'=> 'User',
275                         'source'=> 'non-db',
276                 ),
277                 'modified_user_link' => array (
278                         'name' => 'modified_user_link',
279                         'type' => 'link',
280                         'relationship' => 'emails_modified_user',
281                         'vname' => 'LBL_MODIFIED_BY_USER',
282                         'link_type' => 'one',
283                         'module'=> 'Users',
284                         'bean_name'=> 'User',
285                         'source'=> 'non-db',
286                 ),
287                 'assigned_user_link' => array (
288                         'name' => 'assigned_user_link',
289                         'type' => 'link',
290                         'relationship' => 'emails_assigned_user',
291                         'vname' => 'LBL_ASSIGNED_TO_USER',
292                         'link_type' => 'one',
293                         'module'=> 'Users',
294                         'bean_name'=> 'User',
295                         'source'=> 'non-db',
296                 ),
297
298                 'parent_name' => array (
299                         'name' => 'parent_name',
300                         'type' => 'varchar',
301                         'reportable'=>false,
302                         'source'=> 'non-db',
303                 ),
304                 'parent_type' => array (
305                         'name' => 'parent_type',
306                         'type' => 'varchar',
307                         'reportable'=>false,
308                         'len' => 100,
309                         'comment' => 'Identifier of Sugar module to which this email is associated (deprecated as of 4.2)',
310                 ),
311                 'parent_id' => array (
312                         'name' => 'parent_id',
313                         'type' => 'id',
314                         'len' => '36',
315                         'reportable'=>false,
316                         'comment' => 'ID of Sugar object referenced by parent_type (deprecated as of 4.2)',
317                 ),
318
319                 /* relationship collection attributes */
320                 /* added to support InboundEmail */
321                 'accounts'      => array (
322                         'name'                  => 'accounts',
323                         'vname'                 => 'LBL_EMAILS_ACCOUNTS_REL',
324                         'type'                  => 'link',
325                         'relationship'  => 'emails_accounts_rel',
326                         'module'                => 'Accounts',
327                         'bean_name'             => 'Account',
328                         'source'                => 'non-db',
329                 ),
330                 'bugs'  => array (
331                         'name'                  => 'bugs',
332                         'vname'                 => 'LBL_EMAILS_BUGS_REL',
333                         'type'                  => 'link',
334                         'relationship'  => 'emails_bugs_rel',
335                         'module'                => 'Bugs',
336                         'bean_name'             => 'Bug',
337                         'source'                => 'non-db',
338                 ),
339                 'cases' => array (
340                         'name'                  => 'cases',
341                         'vname'                 => 'LBL_EMAILS_CASES_REL',
342                         'type'                  => 'link',
343                         'relationship'  => 'emails_cases_rel',
344                         'module'                => 'Cases',
345                         'bean_name'             => 'Case',
346                         'source'                => 'non-db',
347                 ),
348                 'contacts'      => array (
349                         'name'                  => 'contacts',
350                         'vname'                 => 'LBL_EMAILS_CONTACTS_REL',
351                         'type'                  => 'link',
352                         'relationship'  => 'emails_contacts_rel',
353                         'module'                => 'Contacts',
354                         'bean_name'             => 'Contact',
355                         'source'                => 'non-db',
356                 ),
357                 'leads' => array (
358                         'name'                  => 'leads',
359                         'vname'                 => 'LBL_EMAILS_LEADS_REL',
360                         'type'                  => 'link',
361                         'relationship'  => 'emails_leads_rel',
362                         'module'                => 'Leads',
363                         'bean_name'             => 'Lead',
364                         'source'                => 'non-db',
365                 ),
366                 'opportunities' => array (
367                         'name'                  => 'opportunities',
368                         'vname'                 => 'LBL_EMAILS_OPPORTUNITIES_REL',
369                         'type'                  => 'link',
370                         'relationship'  => 'emails_opportunities_rel',
371                         'module'                => 'Opportunities',
372                         'bean_name'             => 'Opportunity',
373                         'source'                => 'non-db',
374                 ),
375                 'project'=> array(
376                         'name'                  => 'project',
377                         'vname'                 => 'LBL_EMAILS_PROJECT_REL',
378                         'type'                  => 'link',
379                         'relationship'  => 'emails_projects_rel',
380                         'module'                => 'Project',
381                         'bean_name'             => 'Project',
382                         'source'                => 'non-db',
383                 ),
384                 'projecttask'=> array(
385                         'name'                  => 'projecttask',
386                         'vname'                 => 'LBL_EMAILS_PROJECT_TASK_REL',
387                         'type'                  => 'link',
388                         'relationship'  => 'emails_project_task_rel',
389                         'module'                => 'ProjectTask',
390                         'bean_name'             => 'ProjectTask',
391                         'source'                => 'non-db',
392                 ),
393                 'prospects'=> array(
394                         'name'                  => 'prospects',
395                         'vname'                 => 'LBL_EMAILS_PROSPECT_REL',
396                         'type'                  => 'link',
397                         'relationship'  => 'emails_prospects_rel',
398                         'module'                => 'Prospects',
399                         'bean_name'             => 'Prospect',
400                         'source'                => 'non-db',
401                 ),
402
403                 
404                 'tasks'=> array(
405                         'name'                  => 'tasks',
406                         'vname'                 => 'LBL_EMAILS_TASKS_REL',
407                         'type'                  => 'link',
408                         'relationship'  => 'emails_tasks_rel',
409                         'module'                => 'Tasks',
410                         'bean_name'             => 'Task',
411                         'source'                => 'non-db',
412                 ),
413                 'users'=> array(
414                         'name'                  => 'users',
415                         'vname'                 => 'LBL_EMAILS_USERS_REL',
416                         'type'                  => 'link',
417                         'relationship'  => 'emails_users_rel',
418                         'module'                => 'Users',
419                         'bean_name'             => 'User',
420                         'source'                => 'non-db',
421                 ),
422                 'notes' => array(
423                         'name'                  => 'notes',
424                         'vname'                 => 'LBL_EMAILS_NOTES_REL',
425                         'type'                  => 'link',
426                         'relationship'  => 'emails_notes_rel',
427                         'module'                => 'Notes',
428                         'bean_name'             => 'Note',
429                         'source'                => 'non-db',
430                 ),
431                 // SNIP
432                 'meetings' => array(
433             'name'                      => 'meetings',
434             'vname'                     => 'LBL_EMAILS_MEETINGS_REL',
435             'type'                      => 'link',
436             'relationship'  => 'emails_meetings_rel',
437             'module'            => 'Meetings',
438             'bean_name'         => 'Meeting',
439             'source'            => 'non-db',
440                 ),
441                 /* end relationship collections */
442
443         ), /* end fields() array */
444         'relationships' => array(
445                 'emails_assigned_user'  => array(
446                         'lhs_module'            => 'Users',
447                         'lhs_table'                     => 'users',
448                         'lhs_key'                       => 'id',
449                         'rhs_module'            => 'Emails',
450                         'rhs_table'                     => 'emails',
451                         'rhs_key'                       => 'assigned_user_id',
452                         'relationship_type'     => 'one-to-many'
453                 ),
454                 'emails_modified_user'  => array(
455                         'lhs_module'            => 'Users',
456                         'lhs_table'                     => 'users',
457                         'lhs_key'                       => 'id',
458                         'rhs_module'            => 'Emails',
459                         'rhs_table'                     => 'emails',
460                         'rhs_key'                       => 'modified_user_id',
461                         'relationship_type'     => 'one-to-many'
462                 ),
463                 'emails_created_by'             => array(
464                         'lhs_module'            => 'Users',
465                         'lhs_table'                     => 'users',
466                         'lhs_key'                       => 'id',
467                         'rhs_module'            => 'Emails',
468                         'rhs_table'                     => 'emails',
469                         'rhs_key'                       => 'created_by',
470                         'relationship_type'     => 'one-to-many'
471                 ),
472                 'emails_notes_rel' => array(
473                         'lhs_module'            => 'Emails',
474                         'lhs_table'                     => 'emails',
475                         'lhs_key'                       => 'id',
476                         'rhs_module'            => 'Notes',
477                         'rhs_table'                     => 'notes',
478                         'rhs_key'                       => 'parent_id',
479                         'relationship_type'     => 'one-to-many',
480                 ),
481         'emails_contacts_rel' => array(
482             'lhs_module'                        => 'Emails',
483             'lhs_table'                         => 'emails',
484             'lhs_key'                           => 'id',
485             'rhs_module'                        => 'Contacts',
486             'rhs_table'                         => 'contacts',
487             'rhs_key'                           => 'id',
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',
494         ),
495         'emails_accounts_rel' => array(
496             'lhs_module'                        => 'Emails',
497             'lhs_table'                         => 'emails',
498             'lhs_key'                           => 'id',
499             'rhs_module'                        => 'Accounts',
500             'rhs_table'                         => 'accounts',
501             'rhs_key'                           => 'id',
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',
508         ),
509         'emails_leads_rel' => array(
510             'lhs_module'                        => 'Emails',
511             'lhs_table'                         => 'emails',
512             'lhs_key'                           => 'id',
513             'rhs_module'                        => 'Leads',
514             'rhs_table'                         => 'leads',
515             'rhs_key'                           => 'id',
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',
522         ),
523                 // SNIP
524                 'emails_meetings_rel' => array(
525                         'lhs_module'                     => 'Emails',
526                         'lhs_table'          => 'emails',
527                         'lhs_key'            => 'id',
528                         'rhs_module'         => 'Meetings',
529                         'rhs_table'          => 'meetings',
530                         'rhs_key'            => 'parent_id',
531                         'relationship_type'  => 'one-to-many',
532                 ),
533         ), // end relationships
534         'indices' => array (
535                 array(
536                         'name'                          => 'emailspk',
537                         'type'                          => 'primary',
538                         'fields'                        => array('id'),
539                 ),
540                 array(
541                         'name'                          => 'idx_email_name',
542                         'type'                          => 'index',
543                         'fields'                        => array('name')
544                 ),
545                 array(
546                         'name'                          => 'idx_message_id',
547                         'type'                          => 'index',
548                         'fields'                        => array('message_id')
549                 ),
550                 array(
551                         'name'                          => 'idx_email_parent_id',
552                         'type'                          => 'index',
553                         'fields'                        => array('parent_id')
554                 ),
555                 array(
556                         'name'                          => 'idx_email_assigned',
557                         'type'                          => 'index',
558                         'fields'                        => array('assigned_user_id', 'type','status')
559                 ),
560         ) // end indices
561 );
562
563 VardefManager::createVardef('Emails','Email', array(
564 ));