]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Emails/vardefs.php
Release 6.5.0
[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-2012 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' => 'varchar',
215                         'required' => false,
216                         'len' => '255',
217                         'comment' => 'The subject of the email',
218                 ),
219                 'type' => array (
220                         'name' => 'type',
221                         'vname' => 'LBL_LIST_TYPE',
222                         'type' => 'enum',
223                         'options' => 'dom_email_types',
224                         'len' => 100,
225                         'massupdate'=>false,
226                         'comment' => 'Type of email (ex: draft)',
227                 ),
228                 'status' => array (
229                         'name' => 'status',
230                         'vname' => 'LBL_STATUS',
231                         'type' => 'enum',
232                         'len' => 100,
233                         'options' => 'dom_email_status',
234                 ),
235                 'flagged' => array (
236                         'name' => 'flagged',
237                         'vname' => 'LBL_EMAIL_FLAGGED',
238                         'type' => 'bool',
239                         'required' => false,
240                         'reportable'=>false,
241                         'comment' => 'flagged status',
242                 ),
243                 'reply_to_status' => array (
244                         'name' => 'reply_to_status',
245                         'vname' => 'LBL_EMAIL_REPLY_TO_STATUS',
246                         'type' => 'bool',
247                         'required' => false,
248                         'reportable'=>false,
249                         'comment' => 'I you reply to an email then reply to status of original email is set',
250                 ),
251                 'intent' => array (
252                         'name'  => 'intent',
253                         'vname' => 'LBL_INTENT',
254                         'type'  => 'varchar',
255                         'len' => 100,
256                         'default'       => 'pick',
257                         'comment' => 'Target of action used in Inbound Email assignment',
258                 ),
259                 'mailbox_id' => array (
260                         'name' => 'mailbox_id',
261                         'vname' => 'LBL_MAILBOX_ID',
262                         'type' => 'id',
263                         'len'=> '36',
264                         'reportable' => false,
265                 ),
266                 'created_by_link' => array (
267                         'name' => 'created_by_link',
268                         'type' => 'link',
269                         'relationship' => 'emails_created_by',
270                         'vname' => 'LBL_CREATED_BY_USER',
271                         'link_type' => 'one',
272                         'module'=> 'Users',
273                         'bean_name'=> 'User',
274                         'source'=> 'non-db',
275                 ),
276                 'modified_user_link' => array (
277                         'name' => 'modified_user_link',
278                         'type' => 'link',
279                         'relationship' => 'emails_modified_user',
280                         'vname' => 'LBL_MODIFIED_BY_USER',
281                         'link_type' => 'one',
282                         'module'=> 'Users',
283                         'bean_name'=> 'User',
284                         'source'=> 'non-db',
285                 ),
286                 'assigned_user_link' => array (
287                         'name' => 'assigned_user_link',
288                         'type' => 'link',
289                         'relationship' => 'emails_assigned_user',
290                         'vname' => 'LBL_ASSIGNED_TO_USER',
291                         'link_type' => 'one',
292                         'module'=> 'Users',
293                         'bean_name'=> 'User',
294                         'source'=> 'non-db',
295                 ),
296
297                 'parent_name' => array (
298                         'name' => 'parent_name',
299                         'type' => 'varchar',
300                         'reportable'=>false,
301                         'source'=> 'non-db',
302                 ),
303                 'parent_type' => array (
304                         'name' => 'parent_type',
305                         'type' => 'varchar',
306                         'reportable'=>false,
307                         'len' => 100,
308                         'comment' => 'Identifier of Sugar module to which this email is associated (deprecated as of 4.2)',
309                 ),
310                 'parent_id' => array (
311                         'name' => 'parent_id',
312                         'type' => 'id',
313                         'len' => '36',
314                         'reportable'=>false,
315                         'comment' => 'ID of Sugar object referenced by parent_type (deprecated as of 4.2)',
316                 ),
317
318                 /* relationship collection attributes */
319                 /* added to support InboundEmail */
320                 'accounts'      => array (
321                         'name'                  => 'accounts',
322                         'vname'                 => 'LBL_EMAILS_ACCOUNTS_REL',
323                         'type'                  => 'link',
324                         'relationship'  => 'emails_accounts_rel',
325                         'module'                => 'Accounts',
326                         'bean_name'             => 'Account',
327                         'source'                => 'non-db',
328                 ),
329                 'bugs'  => array (
330                         'name'                  => 'bugs',
331                         'vname'                 => 'LBL_EMAILS_BUGS_REL',
332                         'type'                  => 'link',
333                         'relationship'  => 'emails_bugs_rel',
334                         'module'                => 'Bugs',
335                         'bean_name'             => 'Bug',
336                         'source'                => 'non-db',
337                 ),
338                 'cases' => array (
339                         'name'                  => 'cases',
340                         'vname'                 => 'LBL_EMAILS_CASES_REL',
341                         'type'                  => 'link',
342                         'relationship'  => 'emails_cases_rel',
343                         'module'                => 'Cases',
344                         'bean_name'             => 'Case',
345                         'source'                => 'non-db',
346                 ),
347                 'contacts'      => array (
348                         'name'                  => 'contacts',
349                         'vname'                 => 'LBL_EMAILS_CONTACTS_REL',
350                         'type'                  => 'link',
351                         'relationship'  => 'emails_contacts_rel',
352                         'module'                => 'Contacts',
353                         'bean_name'             => 'Contact',
354                         'source'                => 'non-db',
355                 ),
356                 'leads' => array (
357                         'name'                  => 'leads',
358                         'vname'                 => 'LBL_EMAILS_LEADS_REL',
359                         'type'                  => 'link',
360                         'relationship'  => 'emails_leads_rel',
361                         'module'                => 'Leads',
362                         'bean_name'             => 'Lead',
363                         'source'                => 'non-db',
364                 ),
365                 'opportunities' => array (
366                         'name'                  => 'opportunities',
367                         'vname'                 => 'LBL_EMAILS_OPPORTUNITIES_REL',
368                         'type'                  => 'link',
369                         'relationship'  => 'emails_opportunities_rel',
370                         'module'                => 'Opportunities',
371                         'bean_name'             => 'Opportunity',
372                         'source'                => 'non-db',
373                 ),
374                 'project'=> array(
375                         'name'                  => 'project',
376                         'vname'                 => 'LBL_EMAILS_PROJECT_REL',
377                         'type'                  => 'link',
378                         'relationship'  => 'emails_projects_rel',
379                         'module'                => 'Project',
380                         'bean_name'             => 'Project',
381                         'source'                => 'non-db',
382                 ),
383                 'projecttask'=> array(
384                         'name'                  => 'projecttask',
385                         'vname'                 => 'LBL_EMAILS_PROJECT_TASK_REL',
386                         'type'                  => 'link',
387                         'relationship'  => 'emails_project_task_rel',
388                         'module'                => 'ProjectTask',
389                         'bean_name'             => 'ProjectTask',
390                         'source'                => 'non-db',
391                 ),
392                 'prospects'=> array(
393                         'name'                  => 'prospects',
394                         'vname'                 => 'LBL_EMAILS_PROSPECT_REL',
395                         'type'                  => 'link',
396                         'relationship'  => 'emails_prospects_rel',
397                         'module'                => 'Prospects',
398                         'bean_name'             => 'Prospect',
399                         'source'                => 'non-db',
400                 ),
401
402                 
403                 'tasks'=> array(
404                         'name'                  => 'tasks',
405                         'vname'                 => 'LBL_EMAILS_TASKS_REL',
406                         'type'                  => 'link',
407                         'relationship'  => 'emails_tasks_rel',
408                         'module'                => 'Tasks',
409                         'bean_name'             => 'Task',
410                         'source'                => 'non-db',
411                 ),
412                 'users'=> array(
413                         'name'                  => 'users',
414                         'vname'                 => 'LBL_EMAILS_USERS_REL',
415                         'type'                  => 'link',
416                         'relationship'  => 'emails_users_rel',
417                         'module'                => 'Users',
418                         'bean_name'             => 'User',
419                         'source'                => 'non-db',
420                 ),
421                 'notes' => array(
422                         'name'                  => 'notes',
423                         'vname'                 => 'LBL_EMAILS_NOTES_REL',
424                         'type'                  => 'link',
425                         'relationship'  => 'emails_notes_rel',
426                         'module'                => 'Notes',
427                         'bean_name'             => 'Note',
428                         'source'                => 'non-db',
429                 ),
430                 // SNIP
431                 'meetings' => array(
432             'name'                      => 'meetings',
433             'vname'                     => 'LBL_EMAILS_MEETINGS_REL',
434             'type'                      => 'link',
435             'relationship'  => 'emails_meetings_rel',
436             'module'            => 'Meetings',
437             'bean_name'         => 'Meeting',
438             'source'            => 'non-db',
439                 ),
440                 /* end relationship collections */
441
442         ), /* end fields() array */
443         'relationships' => array(
444                 'emails_assigned_user'  => array(
445                         'lhs_module'            => 'Users',
446                         'lhs_table'                     => 'users',
447                         'lhs_key'                       => 'id',
448                         'rhs_module'            => 'Emails',
449                         'rhs_table'                     => 'emails',
450                         'rhs_key'                       => 'assigned_user_id',
451                         'relationship_type'     => 'one-to-many'
452                 ),
453                 'emails_modified_user'  => array(
454                         'lhs_module'            => 'Users',
455                         'lhs_table'                     => 'users',
456                         'lhs_key'                       => 'id',
457                         'rhs_module'            => 'Emails',
458                         'rhs_table'                     => 'emails',
459                         'rhs_key'                       => 'modified_user_id',
460                         'relationship_type'     => 'one-to-many'
461                 ),
462                 'emails_created_by'             => array(
463                         'lhs_module'            => 'Users',
464                         'lhs_table'                     => 'users',
465                         'lhs_key'                       => 'id',
466                         'rhs_module'            => 'Emails',
467                         'rhs_table'                     => 'emails',
468                         'rhs_key'                       => 'created_by',
469                         'relationship_type'     => 'one-to-many'
470                 ),
471                 'emails_notes_rel' => array(
472                         'lhs_module'            => 'Emails',
473                         'lhs_table'                     => 'emails',
474                         'lhs_key'                       => 'id',
475                         'rhs_module'            => 'Notes',
476                         'rhs_table'                     => 'notes',
477                         'rhs_key'                       => 'parent_id',
478                         'relationship_type'     => 'one-to-many',
479                 ),
480
481                 // SNIP
482                 'emails_meetings_rel' => array(
483                         'lhs_module'                     => 'Emails',
484                         'lhs_table'          => 'emails',
485                         'lhs_key'            => 'id',
486                         'rhs_module'         => 'Meetings',
487                         'rhs_table'          => 'meetings',
488                         'rhs_key'            => 'parent_id',
489                         'relationship_type'  => 'one-to-many',
490                 ),
491         ), // end relationships
492         'indices' => array (
493                 array(
494                         'name'                          => 'emailspk',
495                         'type'                          => 'primary',
496                         'fields'                        => array('id'),
497                 ),
498                 array(
499                         'name'                          => 'idx_email_name',
500                         'type'                          => 'index',
501                         'fields'                        => array('name')
502                 ),
503                 array(
504                         'name'                          => 'idx_message_id',
505                         'type'                          => 'index',
506                         'fields'                        => array('message_id')
507                 ),
508                 array(
509                         'name'                          => 'idx_email_parent_id',
510                         'type'                          => 'index',
511                         'fields'                        => array('parent_id')
512                 ),
513                 array(
514                         'name'                          => 'idx_email_assigned',
515                         'type'                          => 'index',
516                         'fields'                        => array('assigned_user_id', 'type','status')
517                 ),
518         ) // end indices
519 );
520
521 VardefManager::createVardef('Emails','Email', array(
522 ));