]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/EmailTemplates/vardefs.php
Release 6.2.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-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 $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_NAME',
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                 ),
97                 'description' => array(
98                         'name' => 'description',
99                         'vname' => 'LBL_DESCRIPTION',
100                         'type' => 'text',
101                         'comment' => 'Email template description'
102                 ),
103                 'subject' => array(
104                         'name' => 'subject',
105                         'vname' => 'LBL_SUBJECT',
106                         'type' => 'varchar',
107                         'len' => '255',
108                         'comment' => 'Email subject to be used in resulting email'
109                 ),
110                 'body' => array(
111                         'name' => 'body',
112                         'vname' => 'LBL_BODY',
113                         'type' => 'text',
114                         'comment' => 'Plain text body to be used in resulting email'
115                 ),
116                 'body_html' => array(
117                         'name' => 'body_html',
118                         'vname' => 'LBL_PLAIN_TEXT',
119                         'type' => 'text',
120                         'comment' => 'HTML formatted email body to be used in resulting email'
121                 ),
122                 'deleted' => array(
123                         'name' => 'deleted',
124                         'vname' => 'LBL_DELETED',
125                         'type' => 'bool',
126                         'required' => false,
127                         'reportable'=>false,
128                         'comment' => 'Record deletion indicator'
129                 ),
130                 'assigned_user_id' => array (
131                         'name' => 'assigned_user_id',
132                         'rname' => 'user_name',
133                         'id_name' => 'assigned_user_id',
134                         'vname' => 'LBL_ASSIGNED_TO_ID',
135                         'group'=>'assigned_user_name',
136                         'type' => 'relate',
137                         'table' => 'users',
138                         'module' => 'Users',
139                         'reportable'=>true,
140                         'isnull' => 'false',
141                         'dbType' => 'id',
142                         'audited'=>true,
143                         'comment' => 'User ID assigned to record',
144             'duplicate_merge'=>'disabled'           
145                 ),
146          'assigned_user_name' => array (
147                  'name' => 'assigned_user_name',
148                  'link'=>'assigned_user_link' ,
149                  'vname' => 'LBL_ASSIGNED_TO_NAME',
150                  'rname' => 'user_name',
151                  'type' => 'relate',
152                  'reportable'=>false,
153                  'source'=>'non-db',
154                  'table' => 'users',
155                  'id_name' => 'assigned_user_id',
156                  'module'=>'Users',
157                  'duplicate_merge'=>'disabled'
158          ),
159                  'assigned_user_link' => array (
160                  'name' => 'assigned_user_link',
161                  'type' => 'link',
162                  'relationship' => 'emailtemplates_assigned_user',
163                  'vname' => 'LBL_ASSIGNED_TO_USER',
164                  'link_type' => 'one',
165                  'module'=>'Users',
166                  'bean_name'=>'User',
167                  'source'=>'non-db',
168                  'duplicate_merge'=>'enabled',
169                  'rname' => 'user_name',
170                  'id_name' => 'assigned_user_id',
171                  'table' => 'users',
172           ),
173         'text_only' => array(
174             'name' => 'text_only',
175             'vname' => 'LBL_TEXT_ONLY',
176             'type' => 'bool',
177             'required' => false,
178             'reportable'=>false,
179             'comment' => 'Should be checked if email template is to be sent in text only'
180         ),
181         ),
182         'indices' => array(
183                 array(
184                         'name' => 'email_templatespk',
185                         'type' =>'primary',
186                         'fields'=>array('id')
187                 ),
188                 array(
189                         'name' => 'idx_email_template_name',
190                         'type'=>'index',
191                         'fields'=>array('name')
192                 )
193         ),
194         'relationships' => array(
195         'emailtemplates_assigned_user' =>
196        array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
197        'rhs_module'=> 'EmailTemplates' , 'rhs_table'=> 'email_templates', 'rhs_key' => 'assigned_user_id',
198        'relationship_type'=>'one-to-many')
199         ),
200 );
201
202 VardefManager::createVardef('EmailTemplates','EmailTemplate', array(
203 ));
204 ?>