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.
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',
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',
71 'refer_url' => array (
72 'name' => 'refer_url',
73 'vname' => 'LBL_REFER_URL',
76 'default' => 'http://',
77 'comment' => 'The URL referenced in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
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',
85 'comment' => 'The text that appears in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
88 'start_date' => array (
89 'name' => 'start_date',
90 'vname' => 'LBL_CAMPAIGN_START_DATE',
93 'comment' => 'Starting date of the campaign',
94 'validation' => array ('type' => 'isbefore', 'compareto' => 'end_date'),
98 'vname' => 'LBL_CAMPAIGN_END_DATE',
101 'comment' => 'Ending date of the campaign',
102 'importable' => 'required',
107 'vname' => 'LBL_CAMPAIGN_STATUS',
109 'options' => 'campaign_status_dom',
112 'comment' => 'Status of the campaign',
113 'importable' => 'required',
116 'impressions' => array (
117 'name' => 'impressions',
118 'vname' => 'LBL_CAMPAIGN_IMPRESSIONS',
122 'comment' => 'Expected Click throughs manually entered by Campaign Manager'
126 'name' => 'currency_id',
127 'vname' => 'LBL_CURRENCY',
129 'group'=>'currency_id',
130 'function'=>array('name'=>'getCurrencyDropDown', 'returns'=>'html'),
134 'comment' => 'Currency in use for the campaign'
138 'vname' => 'LBL_CAMPAIGN_BUDGET',
139 'type' => 'currency',
140 'dbType' => 'double',
141 'comment' => 'Budgeted amount for the campaign'
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'
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'
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'
164 'campaign_type' => array (
165 'name' => 'campaign_type',
166 'vname' => 'LBL_CAMPAIGN_TYPE',
168 'options' => 'campaign_type_dom',
171 'comment' => 'The type of campaign',
172 'importable' => 'required',
175 'objective' => array (
176 'name' => 'objective',
177 'vname' => 'LBL_CAMPAIGN_OBJECTIVE',
179 'comment' => 'The objective of the campaign'
183 'vname' => 'LBL_CAMPAIGN_CONTENT',
185 'comment' => 'The campaign description'
187 'prospectlists'=> array (
188 'name' => 'prospectlists',
190 'relationship' => 'prospect_list_campaigns',
193 'emailmarketing'=> array (
194 'name' => 'emailmarketing',
196 'relationship' => 'campaign_email_marketing',
199 'queueitems'=> array (
200 'name' => 'queueitems',
202 'relationship' => 'campaign_emailman',
205 'log_entries'=> array (
206 'name' => 'log_entries',
208 'relationship' => 'campaign_campaignlog',
210 'vname' => 'LBL_LOG_ENTRIES',
212 'tracked_urls' => array (
213 'name' => 'tracked_urls',
215 'relationship' => 'campaign_campaigntrakers',
217 'vname'=>'LBL_TRACKED_URLS',
219 'frequency' => array (
220 'name' => 'frequency',
221 'vname' => 'LBL_CAMPAIGN_FREQUENCY',
223 //'options' => 'campaign_status_dom',
225 'comment' => 'Frequency of the campaign',
226 'options' => 'newsletter_frequency_dom',
232 'relationship' => 'campaign_leads',
234 'vname' => 'LBL_LEADS',
237 'opportunities'=> array (
238 'name' => 'opportunities',
240 'relationship' => 'campaign_opportunities',
242 'vname' => 'LBL_OPPORTUNITIES',
245 'name' => 'contacts',
247 'relationship' => 'campaign_contacts',
249 'vname' => 'LBL_CONTACTS',
252 'name' => 'accounts',
254 'relationship' => 'campaign_accounts',
256 'vname' => 'LBL_ACCOUNTS',
263 'name' => 'camp_auto_tracker_key' ,
265 'fields'=>array('tracker_key')
268 'name' =>'idx_campaign_name',
270 'fields'=>array('name')
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'),
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'),
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'),
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'),
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'),
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'),
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'),
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'),
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'),
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'),
316 VardefManager::createVardef('Campaigns','Campaign', array('default', 'assignable',