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.
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.
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
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
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.
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.
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 ********************************************************************************/
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,
44 'tracker_key' => array (
45 'name' => 'tracker_key',
46 'vname' => 'LBL_TRACKER_KEY',
49 'studio' => array('editview' => false),
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)'
54 'tracker_count' => array (
55 'name' => 'tracker_count',
56 'vname' => 'LBL_TRACKER_COUNT',
60 'comment' => 'The number of accesses made to the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
64 'vname' => 'LBL_CAMPAIGN_NAME',
65 'dbType' => 'varchar',
68 'comment' => 'The name of the campaign',
69 'importable' => 'required',
71 'unified_search' => true,
72 'full_text_search' => array('boost' => 3),
74 'refer_url' => array (
75 'name' => 'refer_url',
76 'vname' => 'LBL_REFER_URL',
79 'default' => 'http://',
80 'comment' => 'The URL referenced in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
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',
88 'comment' => 'The text that appears in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
91 'start_date' => array (
92 'name' => 'start_date',
93 'vname' => 'LBL_CAMPAIGN_START_DATE',
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',
101 'end_date' => array (
102 'name' => 'end_date',
103 'vname' => 'LBL_CAMPAIGN_END_DATE',
106 'comment' => 'Ending date of the campaign',
107 'importable' => 'required',
109 'enable_range_search' => true,
110 'options' => 'date_range_search_dom',
114 'vname' => 'LBL_CAMPAIGN_STATUS',
116 'options' => 'campaign_status_dom',
119 'comment' => 'Status of the campaign',
120 'importable' => 'required',
123 'impressions' => array (
124 'name' => 'impressions',
125 'vname' => 'LBL_CAMPAIGN_IMPRESSIONS',
129 'comment' => 'Expected Click throughs manually entered by Campaign Manager'
133 'name' => 'currency_id',
134 'vname' => 'LBL_CURRENCY',
136 'group'=>'currency_id',
137 'function'=>array('name'=>'getCurrencyDropDown', 'returns'=>'html'),
141 'comment' => 'Currency in use for the campaign'
145 'vname' => 'LBL_CAMPAIGN_BUDGET',
146 'type' => 'currency',
147 'dbType' => 'double',
148 'comment' => 'Budgeted amount for the campaign'
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'
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'
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'
171 'campaign_type' => array (
172 'name' => 'campaign_type',
173 'vname' => 'LBL_CAMPAIGN_TYPE',
175 'options' => 'campaign_type_dom',
178 'comment' => 'The type of campaign',
179 'importable' => 'required',
182 'objective' => array (
183 'name' => 'objective',
184 'vname' => 'LBL_CAMPAIGN_OBJECTIVE',
186 'comment' => 'The objective of the campaign'
190 'vname' => 'LBL_CAMPAIGN_CONTENT',
192 'comment' => 'The campaign description'
194 'prospectlists'=> array (
195 'name' => 'prospectlists',
197 'relationship' => 'prospect_list_campaigns',
200 'emailmarketing'=> array (
201 'name' => 'emailmarketing',
203 'relationship' => 'campaign_email_marketing',
206 'queueitems'=> array (
207 'name' => 'queueitems',
209 'relationship' => 'campaign_emailman',
212 'log_entries'=> array (
213 'name' => 'log_entries',
215 'relationship' => 'campaign_campaignlog',
217 'vname' => 'LBL_LOG_ENTRIES',
219 'tracked_urls' => array (
220 'name' => 'tracked_urls',
222 'relationship' => 'campaign_campaigntrakers',
224 'vname'=>'LBL_TRACKED_URLS',
226 'frequency' => array (
227 'name' => 'frequency',
228 'vname' => 'LBL_CAMPAIGN_FREQUENCY',
230 //'options' => 'campaign_status_dom',
232 'comment' => 'Frequency of the campaign',
233 'options' => 'newsletter_frequency_dom',
239 'relationship' => 'campaign_leads',
241 'vname' => 'LBL_LEADS',
242 'link_class' => 'ProspectLink',
243 'link_file' => 'modules/Campaigns/ProspectLink.php'
246 'opportunities'=> array (
247 'name' => 'opportunities',
249 'relationship' => 'campaign_opportunities',
251 'vname' => 'LBL_OPPORTUNITIES',
254 'name' => 'contacts',
256 'relationship' => 'campaign_contacts',
258 'vname' => 'LBL_CONTACTS',
259 'link_class' => 'ProspectLink',
260 'link_file' => 'modules/Campaigns/ProspectLink.php'
263 'name' => 'accounts',
265 'relationship' => 'campaign_accounts',
267 'vname' => 'LBL_ACCOUNTS',
268 'link_class' => 'ProspectLink',
269 'link_file' => 'modules/Campaigns/ProspectLink.php'
276 'name' => 'camp_auto_tracker_key' ,
278 'fields'=>array('tracker_key')
281 'name' =>'idx_campaign_name',
283 'fields'=>array('name')
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'),
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'),
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'),
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'),
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'),
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'),
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'),
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'),
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'),
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'),
329 VardefManager::createVardef('Campaigns','Campaign', array('default', 'assignable',