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.
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,
43 'tracker_key' => array (
44 'name' => 'tracker_key',
45 'vname' => 'LBL_TRACKER_KEY',
48 'studio' => array('editview' => false),
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)'
53 'tracker_count' => array (
54 'name' => 'tracker_count',
55 'vname' => 'LBL_TRACKER_COUNT',
59 'comment' => 'The number of accesses made to the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
63 'vname' => 'LBL_CAMPAIGN_NAME',
64 'dbType' => 'varchar',
67 'comment' => 'The name of the campaign',
68 'importable' => 'required',
70 'unified_search' => true,
72 'refer_url' => array (
73 'name' => 'refer_url',
74 'vname' => 'LBL_REFER_URL',
77 'default' => 'http://',
78 'comment' => 'The URL referenced in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
80 'description'=>array('name'=>'description','type'=>'none', 'comment'=>'inhertied but not used', 'source'=>'non-db'),
81 'tracker_text' => array (
82 'name' => 'tracker_text',
83 'vname' => 'LBL_TRACKER_TEXT',
86 'comment' => 'The text that appears in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
89 'start_date' => array (
90 'name' => 'start_date',
91 'vname' => 'LBL_CAMPAIGN_START_DATE',
94 'comment' => 'Starting date of the campaign',
95 'validation' => array ('type' => 'isbefore', 'compareto' => 'end_date'),
96 'enable_range_search' => true,
97 'options' => 'date_range_search_dom',
100 'name' => 'end_date',
101 'vname' => 'LBL_CAMPAIGN_END_DATE',
104 'comment' => 'Ending date of the campaign',
105 'importable' => 'required',
107 'enable_range_search' => true,
108 'options' => 'date_range_search_dom',
112 'vname' => 'LBL_CAMPAIGN_STATUS',
114 'options' => 'campaign_status_dom',
117 'comment' => 'Status of the campaign',
118 'importable' => 'required',
121 'impressions' => array (
122 'name' => 'impressions',
123 'vname' => 'LBL_CAMPAIGN_IMPRESSIONS',
127 'comment' => 'Expected Click throughs manually entered by Campaign Manager'
131 'name' => 'currency_id',
132 'vname' => 'LBL_CURRENCY',
134 'group'=>'currency_id',
135 'function'=>array('name'=>'getCurrencyDropDown', 'returns'=>'html'),
139 'comment' => 'Currency in use for the campaign'
143 'vname' => 'LBL_CAMPAIGN_BUDGET',
144 'type' => 'currency',
145 'dbType' => 'double',
146 'comment' => 'Budgeted amount for the campaign'
148 'expected_cost' => array (
149 'name' => 'expected_cost',
150 'vname' => 'LBL_CAMPAIGN_EXPECTED_COST',
151 'type' => 'currency',
152 'dbType' => 'double',
153 'comment' => 'Expected cost of the campaign'
155 'actual_cost' => array (
156 'name' => 'actual_cost',
157 'vname' => 'LBL_CAMPAIGN_ACTUAL_COST',
158 'type' => 'currency',
159 'dbType' => 'double',
160 'comment' => 'Actual cost of the campaign'
162 'expected_revenue' => array (
163 'name' => 'expected_revenue',
164 'vname' => 'LBL_CAMPAIGN_EXPECTED_REVENUE',
165 'type' => 'currency',
166 'dbType' => 'double',
167 'comment' => 'Expected revenue stemming from the campaign'
169 'campaign_type' => array (
170 'name' => 'campaign_type',
171 'vname' => 'LBL_CAMPAIGN_TYPE',
173 'options' => 'campaign_type_dom',
176 'comment' => 'The type of campaign',
177 'importable' => 'required',
180 'objective' => array (
181 'name' => 'objective',
182 'vname' => 'LBL_CAMPAIGN_OBJECTIVE',
184 'comment' => 'The objective of the campaign'
188 'vname' => 'LBL_CAMPAIGN_CONTENT',
190 'comment' => 'The campaign description'
192 'prospectlists'=> array (
193 'name' => 'prospectlists',
195 'relationship' => 'prospect_list_campaigns',
198 'emailmarketing'=> array (
199 'name' => 'emailmarketing',
201 'relationship' => 'campaign_email_marketing',
204 'queueitems'=> array (
205 'name' => 'queueitems',
207 'relationship' => 'campaign_emailman',
210 'log_entries'=> array (
211 'name' => 'log_entries',
213 'relationship' => 'campaign_campaignlog',
215 'vname' => 'LBL_LOG_ENTRIES',
217 'tracked_urls' => array (
218 'name' => 'tracked_urls',
220 'relationship' => 'campaign_campaigntrakers',
222 'vname'=>'LBL_TRACKED_URLS',
224 'frequency' => array (
225 'name' => 'frequency',
226 'vname' => 'LBL_CAMPAIGN_FREQUENCY',
228 //'options' => 'campaign_status_dom',
230 'comment' => 'Frequency of the campaign',
231 'options' => 'newsletter_frequency_dom',
237 'relationship' => 'campaign_leads',
239 'vname' => 'LBL_LEADS',
242 'opportunities'=> array (
243 'name' => 'opportunities',
245 'relationship' => 'campaign_opportunities',
247 'vname' => 'LBL_OPPORTUNITIES',
250 'name' => 'contacts',
252 'relationship' => 'campaign_contacts',
254 'vname' => 'LBL_CONTACTS',
257 'name' => 'accounts',
259 'relationship' => 'campaign_accounts',
261 'vname' => 'LBL_ACCOUNTS',
268 'name' => 'camp_auto_tracker_key' ,
270 'fields'=>array('tracker_key')
273 'name' =>'idx_campaign_name',
275 'fields'=>array('name')
279 'relationships' => array (
280 'campaign_accounts' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
281 'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts', 'rhs_key' => 'campaign_id',
282 'relationship_type'=>'one-to-many'),
284 'campaign_contacts' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
285 'rhs_module'=> 'Contacts', 'rhs_table'=> 'contacts', 'rhs_key' => 'campaign_id',
286 'relationship_type'=>'one-to-many'),
288 'campaign_leads' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
289 'rhs_module'=> 'Leads', 'rhs_table'=> 'leads', 'rhs_key' => 'campaign_id',
290 'relationship_type'=>'one-to-many'),
292 'campaign_prospects' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
293 'rhs_module'=> 'Prospects', 'rhs_table'=> 'prospects', 'rhs_key' => 'campaign_id',
294 'relationship_type'=>'one-to-many'),
296 'campaign_opportunities' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
297 'rhs_module'=> 'Opportunities', 'rhs_table'=> 'opportunities', 'rhs_key' => 'campaign_id',
298 'relationship_type'=>'one-to-many'),
300 'campaign_email_marketing' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
301 'rhs_module'=> 'EmailMarketing', 'rhs_table'=> 'email_marketing', 'rhs_key' => 'campaign_id',
302 'relationship_type'=>'one-to-many'),
304 'campaign_emailman' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
305 'rhs_module'=> 'EmailMan', 'rhs_table'=> 'emailman', 'rhs_key' => 'campaign_id',
306 'relationship_type'=>'one-to-many'),
308 'campaign_campaignlog' => array('lhs_module'=> 'Campaigns', 'lhs_table'=> 'campaigns', 'lhs_key' => 'id',
309 'rhs_module'=> 'CampaignLog', 'rhs_table'=> 'campaign_log', 'rhs_key' => 'campaign_id',
310 'relationship_type'=>'one-to-many'),
312 'campaign_assigned_user' => array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
313 'rhs_module'=> 'Campaigns', 'rhs_table'=> 'campaigns', 'rhs_key' => 'assigned_user_id',
314 'relationship_type'=>'one-to-many'),
316 'campaign_modified_user' => array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
317 'rhs_module'=> 'Campaigns', 'rhs_table'=> 'campaigns', 'rhs_key' => 'modified_user_id',
318 'relationship_type'=>'one-to-many'),
321 VardefManager::createVardef('Campaigns','Campaign', array('default', 'assignable',