]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/EmailTemplates/vardefs.php
Release 6.5.0
[Github/sugarcrm.git] / modules / EmailTemplates / 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 $dictionary['EmailTemplate'] = array(
39         'table' => 'email_templates', 'comment' => 'Templates used in email processing',
40         'fields' => array(
41                 'id' => array(
42                         'name' => 'id',
43                         'vname' => 'LBL_ID',
44                         'type' => 'id',
45                         'required' => true,
46                         'reportable'=>false,
47                         'comment' => 'Unique identifier'
48                 ),
49                 'date_entered' => array(
50                         'name' => 'date_entered',
51                         'vname' => 'LBL_DATE_ENTERED',
52                         'type' => 'datetime',
53                         'required'=>true,
54                         'comment' => 'Date record created'
55                 ),
56                 'date_modified' => array(
57                         'name' => 'date_modified',
58                         'vname' => 'LBL_DATE_MODIFIED',
59                         'type' => 'datetime',
60                         'required'=>true,
61                         'comment' => 'Date record last modified'
62                 ),
63                 'modified_user_id' => array(
64                         'name' => 'modified_user_id',
65                         'rname' => 'user_name',
66                         'id_name' => 'modified_user_id',
67                         'vname' => 'LBL_ASSIGNED_TO',
68                         'type' => 'assigned_user_name',
69                         'table' => 'users',
70                         'reportable'=>true,
71                         'isnull' => 'false',
72                         'dbType' => 'id',
73                         'comment' => 'User who last modified record'
74                 ),
75                 'created_by' => array(
76                         'name' => 'created_by',
77                         'vname' => 'LBL_CREATED_BY',
78                         'type' => 'varchar',
79                         'len'=> '36',
80                         'comment' => 'User who created record'
81                 ),
82                 'published' => array(
83                         'name' => 'published',
84                         'vname' => 'LBL_PUBLISHED',
85                         'type' => 'varchar',
86                         'len' => '3',
87                         'comment' => ''
88                 ),
89                 'name' => array(
90                         'name' => 'name',
91                         'vname' => 'LBL_NAME',
92                         'type' => 'varchar',
93                         'len' => '255',
94                         'comment' => 'Email template name',
95                         'importable' => 'required',
96             'required' => true
97                 ),
98                 'description' => array(
99                         'name' => 'description',
100                         'vname' => 'LBL_DESCRIPTION',
101                         'type' => 'text',
102                         'comment' => 'Email template description'
103                 ),
104                 'subject' => array(
105                         'name' => 'subject',
106                         'vname' => 'LBL_SUBJECT',
107                         'type' => 'varchar',
108                         'len' => '255',
109                         'comment' => 'Email subject to be used in resulting email'
110                 ),
111                 'body' => array(
112                         'name' => 'body',
113                         'vname' => 'LBL_BODY',
114                         'type' => 'text',
115                         'comment' => 'Plain text body to be used in resulting email'
116                 ),
117                 'body_html' => array(
118                         'name' => 'body_html',
119                         'vname' => 'LBL_PLAIN_TEXT',
120                         'type' => 'html',
121                         'comment' => 'HTML formatted email body to be used in resulting email'
122                 ),
123                 'deleted' => array(
124                         'name' => 'deleted',
125                         'vname' => 'LBL_DELETED',
126                         'type' => 'bool',
127                         'required' => false,
128                         'reportable'=>false,
129                         'comment' => 'Record deletion indicator'
130                 ),
131                 'assigned_user_id' => array (
132                         'name' => 'assigned_user_id',
133                         'rname' => 'user_name',
134                         'id_name' => 'assigned_user_id',
135                         'vname' => 'LBL_ASSIGNED_TO_ID',
136                         'group'=>'assigned_user_name',
137                         'type' => 'relate',
138                         'table' => 'users',
139                         'module' => 'Users',
140                         'reportable'=>true,
141                         'isnull' => 'false',
142                         'dbType' => 'id',
143                         'audited'=>true,
144                         'comment' => 'User ID assigned to record',
145             'duplicate_merge'=>'disabled'
146                 ),
147          'assigned_user_name' => array (
148                  'name' => 'assigned_user_name',
149                  'link'=>'assigned_user_link' ,
150                  'vname' => 'LBL_ASSIGNED_TO_NAME',
151                  'rname' => 'user_name',
152                  'type' => 'relate',
153                  'reportable'=>false,
154                  'source'=>'non-db',
155                  'table' => 'users',
156                  'id_name' => 'assigned_user_id',
157                  'module'=>'Users',
158                  'duplicate_merge'=>'disabled'
159          ),
160                  'assigned_user_link' => array (
161                  'name' => 'assigned_user_link',
162                  'type' => 'link',
163                  'relationship' => 'emailtemplates_assigned_user',
164                  'vname' => 'LBL_ASSIGNED_TO_USER',
165                  'link_type' => 'one',
166                  'module'=>'Users',
167                  'bean_name'=>'User',
168                  'source'=>'non-db',
169                  'duplicate_merge'=>'enabled',
170                  'rname' => 'user_name',
171                  'id_name' => 'assigned_user_id',
172                  'table' => 'users',
173           ),
174         'text_only' => array(
175             'name' => 'text_only',
176             'vname' => 'LBL_TEXT_ONLY',
177             'type' => 'bool',
178             'required' => false,
179             'reportable'=>false,
180             'comment' => 'Should be checked if email template is to be sent in text only'
181         ),
182         'type' => array(
183             'name' => 'type',
184             'vname' => 'LBL_TYPE',
185             'type' => 'enum',
186             'required' => false,
187             'reportable'=> false,
188             'options' => 'emailTemplates_type_list',
189             'comment' => 'Type of the email template'
190        ),
191         ),
192         'indices' => array(
193                 array(
194                         'name' => 'email_templatespk',
195                         'type' =>'primary',
196                         'fields'=>array('id')
197                 ),
198                 array(
199                         'name' => 'idx_email_template_name',
200                         'type'=>'index',
201                         'fields'=>array('name')
202                 )
203         ),
204         'relationships' => array(
205         'emailtemplates_assigned_user' =>
206        array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
207        'rhs_module'=> 'EmailTemplates' , 'rhs_table'=> 'email_templates', 'rhs_key' => 'assigned_user_id',
208        'relationship_type'=>'one-to-many')
209         ),
210 );
211
212 VardefManager::createVardef('EmailTemplates','EmailTemplate', array(
213 ));