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