]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Campaigns/vardefs.php
Release 6.1.4
[Github/sugarcrm.git] / modules / Campaigns / vardefs.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM 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['Campaign'] = array ('audited'=>true,
39         'comment' => 'Campaigns are a series of operations undertaken to accomplish a purpose, usually acquiring leads',
40         'table' => 'campaigns',
41
42         'fields' => array (
43                 'tracker_key' => array (
44                         'name' => 'tracker_key',
45                         'vname' => 'LBL_TRACKER_KEY',
46                         'type' => 'int',
47                         'required' => true,
48                         'studio' => array('editview' => false),
49                         'len' => '11',
50                         'auto_increment' => true,
51                         'comment' => 'The internal ID of the tracker used in a campaign; no longer used as of 4.2 (see campaign_trkrs)'
52                         ),
53                 'tracker_count' => array (
54                         'name' => 'tracker_count',
55                         'vname' => 'LBL_TRACKER_COUNT',
56                         'type' => 'int',
57                         'len' => '11',
58                         'default' => '0',
59                         'comment' => 'The number of accesses made to the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
60                 ),
61                 'name' => array (
62                         'name' => 'name',
63                         'vname' => 'LBL_CAMPAIGN_NAME',
64                         'dbType' => 'varchar',
65                         'type' => 'name',
66                         'len' => '50',
67                         'comment' => 'The name of the campaign',
68                         'importable' => 'required',
69             'required' => true,
70                         ),
71                 'refer_url' => array (
72                         'name' => 'refer_url',
73                         'vname' => 'LBL_REFER_URL',
74                         'type' => 'varchar',
75                         'len' => '255',
76                         'default' => 'http://',
77                         'comment' => 'The URL referenced in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
78                 ),
79                 'description'=>array('name'=>'description','type'=>'none', 'comment'=>'inhertied but not used', 'source'=>'non-db'),
80                 'tracker_text' => array (
81                         'name' => 'tracker_text',
82                         'vname' => 'LBL_TRACKER_TEXT',
83                         'type' => 'varchar',
84                         'len' => '255',
85                         'comment' => 'The text that appears in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
86                 ),
87
88                 'start_date' => array (
89                         'name' => 'start_date',
90                         'vname' => 'LBL_CAMPAIGN_START_DATE',
91                         'type' => 'date',
92                         'audited'=>true,
93                         'comment' => 'Starting date of the campaign',
94                     'validation' => array ('type' => 'isbefore', 'compareto' => 'end_date'),
95                 ),
96                 'end_date' => array (
97                         'name' => 'end_date',
98                         'vname' => 'LBL_CAMPAIGN_END_DATE',
99                         'type' => 'date',
100                         'audited'=>true,
101                         'comment' => 'Ending date of the campaign',
102                         'importable' => 'required',
103             'required' => true,
104                 ),
105                 'status' => array (
106                         'name' => 'status',
107                         'vname' => 'LBL_CAMPAIGN_STATUS',
108                         'type' => 'enum',
109                         'options' => 'campaign_status_dom',
110                         'len' => 100,
111                         'audited'=>true,
112                         'comment' => 'Status of the campaign',
113                         'importable' => 'required',
114             'required' => true,
115                 ),
116                   'impressions' => array (
117                         'name' => 'impressions',
118                         'vname' => 'LBL_CAMPAIGN_IMPRESSIONS',
119                         'type' => 'int',
120                         'default'=>0,
121             'reportable'=>true,
122                         'comment' => 'Expected Click throughs manually entered by Campaign Manager'
123                 ),
124                 'currency_id' =>
125                 array (
126                 'name' => 'currency_id',
127                 'vname' => 'LBL_CURRENCY',
128                 'type' => 'id',
129                 'group'=>'currency_id',
130                 'function'=>array('name'=>'getCurrencyDropDown', 'returns'=>'html'),
131                 'required'=>false,
132                 'do_report'=>false,
133                 'reportable'=>false,
134                 'comment' => 'Currency in use for the campaign'
135                 ),
136                 'budget' => array (
137                         'name' => 'budget',
138                         'vname' => 'LBL_CAMPAIGN_BUDGET',
139                         'type' => 'currency',
140                         'dbType' => 'double',
141                         'comment' => 'Budgeted amount for the campaign'
142                 ),
143                 'expected_cost' => array (
144                         'name' => 'expected_cost',
145                         'vname' => 'LBL_CAMPAIGN_EXPECTED_COST',
146                         'type' => 'currency',
147                         'dbType' => 'double',
148                         'comment' => 'Expected cost of the campaign'
149                 ),
150                 'actual_cost' => array (
151                         'name' => 'actual_cost',
152                         'vname' => 'LBL_CAMPAIGN_ACTUAL_COST',
153                         'type' => 'currency',
154                         'dbType' => 'double',
155                         'comment' => 'Actual cost of the campaign'
156                 ),
157                 'expected_revenue' => array (
158                         'name' => 'expected_revenue',
159                         'vname' => 'LBL_CAMPAIGN_EXPECTED_REVENUE',
160                         'type' => 'currency',
161                         'dbType' => 'double',
162                         'comment' => 'Expected revenue stemming from the campaign'
163                 ),
164                 'campaign_type' => array (
165                         'name' => 'campaign_type',
166                         'vname' => 'LBL_CAMPAIGN_TYPE',
167                         'type' => 'enum',
168                         'options' => 'campaign_type_dom',
169                         'len' => 100,
170                         'audited'=>true,
171                         'comment' => 'The type of campaign',
172                         'importable' => 'required',
173             'required' => true,
174                 ),
175                 'objective' => array (
176                         'name' => 'objective',
177                         'vname' => 'LBL_CAMPAIGN_OBJECTIVE',
178                         'type' => 'text',
179                         'comment' => 'The objective of the campaign'
180                 ),
181                 'content' => array (
182                         'name' => 'content',
183                         'vname' => 'LBL_CAMPAIGN_CONTENT',
184                         'type' => 'text',
185                         'comment' => 'The campaign description'
186                 ),
187                 'prospectlists'=> array (
188                         'name' => 'prospectlists',
189                 'type' => 'link',
190                 'relationship' => 'prospect_list_campaigns',
191                 'source'=>'non-db',
192                 ),
193                 'emailmarketing'=> array (
194                         'name' => 'emailmarketing',
195                 'type' => 'link',
196                 'relationship' => 'campaign_email_marketing',
197                 'source'=>'non-db',
198                 ),
199                 'queueitems'=> array (
200                         'name' => 'queueitems',
201                 'type' => 'link',
202                 'relationship' => 'campaign_emailman',
203                 'source'=>'non-db',
204                 ),
205                 'log_entries'=> array (
206                         'name' => 'log_entries',
207                 'type' => 'link',
208                 'relationship' => 'campaign_campaignlog',
209                 'source'=>'non-db',
210             'vname' => 'LBL_LOG_ENTRIES',
211                 ),
212                 'tracked_urls' => array (
213                         'name' => 'tracked_urls',
214                 'type' => 'link',
215                 'relationship' => 'campaign_campaigntrakers',
216                 'source'=>'non-db',
217                         'vname'=>'LBL_TRACKED_URLS',
218                 ),
219         'frequency' => array (
220             'name' => 'frequency',
221             'vname' => 'LBL_CAMPAIGN_FREQUENCY',
222             'type' => 'enum',
223             //'options' => 'campaign_status_dom',
224             'len' => 100,
225             'comment' => 'Frequency of the campaign',
226             'options' => 'newsletter_frequency_dom',
227             'len' => 100,
228         ),
229         'leads'=> array (
230             'name' => 'leads',
231             'type' => 'link',
232             'relationship' => 'campaign_leads',
233             'source'=>'non-db',
234                     'vname' => 'LBL_LEADS',
235         ),
236
237         'opportunities'=> array (
238             'name' => 'opportunities',
239             'type' => 'link',
240             'relationship' => 'campaign_opportunities',
241             'source'=>'non-db',
242                     'vname' => 'LBL_OPPORTUNITIES',
243         ),
244         'contacts'=> array (
245             'name' => 'contacts',
246             'type' => 'link',
247             'relationship' => 'campaign_contacts',
248             'source'=>'non-db',
249                     'vname' => 'LBL_CONTACTS',
250         ),
251         'accounts'=> array (
252             'name' => 'accounts',
253             'type' => 'link',
254             'relationship' => 'campaign_accounts',
255             'source'=>'non-db',
256                     'vname' => 'LBL_ACCOUNTS',
257         ),
258
259
260         ),
261         'indices' => array (
262                 array (
263                         'name' => 'camp_auto_tracker_key' ,
264                         'type'=>'index' ,
265                         'fields'=>array('tracker_key')
266                 ),
267                 array (
268                         'name' =>'idx_campaign_name',
269                         'type' =>'index',
270                         'fields'=>array('name')
271                 ),
272         ),
273
274         'relationships' => array (
275         'campaign_accounts' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
276                  'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'campaign_id',
277                  'relationship_type'=>'one-to-many'),
278
279         'campaign_contacts' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
280                  'rhs_module'=> 'Contacts', 'rhs_table'=> 'contacts', 'rhs_key' => 'campaign_id',
281                  'relationship_type'=>'one-to-many'),
282
283         'campaign_leads' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
284                  'rhs_module'=> 'Leads', 'rhs_table'=> 'leads', 'rhs_key' => 'campaign_id',
285                  'relationship_type'=>'one-to-many'),
286
287         'campaign_prospects' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
288                  'rhs_module'=> 'Prospects', 'rhs_table'=> 'prospects', 'rhs_key' => 'campaign_id',
289                  'relationship_type'=>'one-to-many'),
290
291         'campaign_opportunities' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
292                  'rhs_module'=> 'Opportunities', 'rhs_table'=> 'opportunities', 'rhs_key' => 'campaign_id',
293                  'relationship_type'=>'one-to-many'),
294
295                 'campaign_email_marketing' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
296                                  'rhs_module'=> 'EmailMarketing', 'rhs_table'=> 'email_marketing', 'rhs_key' => 'campaign_id',
297                                  'relationship_type'=>'one-to-many'),
298
299                 'campaign_emailman' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
300                                  'rhs_module'=> 'EmailMan', 'rhs_table'=> 'emailman', 'rhs_key' => 'campaign_id',
301                                  'relationship_type'=>'one-to-many'),
302
303                 'campaign_campaignlog' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
304                                  'rhs_module'=> 'CampaignLog', 'rhs_table'=> 'campaign_log', 'rhs_key' => 'campaign_id',
305                                  'relationship_type'=>'one-to-many'),
306
307         'campaign_assigned_user' => array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
308                 'rhs_module'=> 'Campaigns', 'rhs_table'=> 'campaigns', 'rhs_key' => 'assigned_user_id',
309                 'relationship_type'=>'one-to-many'),
310
311         'campaign_modified_user' => array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
312                 'rhs_module'=> 'Campaigns', 'rhs_table'=> 'campaigns', 'rhs_key' => 'modified_user_id',
313                 'relationship_type'=>'one-to-many'),
314                 )
315 );
316 VardefManager::createVardef('Campaigns','Campaign', array('default', 'assignable',
317 ));
318 ?>