]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Campaigns/vardefs.php
Release 6.2.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-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         'unified_search' => true,
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                         'unified_search' => true,
71                         ),
72                 'refer_url' => array (
73                         'name' => 'refer_url',
74                         'vname' => 'LBL_REFER_URL',
75                         'type' => 'varchar',
76                         'len' => '255',
77                         'default' => 'http://',
78                         'comment' => 'The URL referenced in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
79                 ),
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',
84                         'type' => 'varchar',
85                         'len' => '255',
86                         'comment' => 'The text that appears in the tracker URL; no longer used as of 4.2 (see campaign_trkrs)'
87                 ),
88
89                 'start_date' => array (
90                         'name' => 'start_date',
91                         'vname' => 'LBL_CAMPAIGN_START_DATE',
92                         'type' => 'date',
93                         'audited'=>true,
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',
98                 ),
99                 'end_date' => array (
100                         'name' => 'end_date',
101                         'vname' => 'LBL_CAMPAIGN_END_DATE',
102                         'type' => 'date',
103                         'audited'=>true,
104                         'comment' => 'Ending date of the campaign',
105                         'importable' => 'required',
106             'required' => true,
107                     'enable_range_search' => true,
108                     'options' => 'date_range_search_dom',
109                 ),
110                 'status' => array (
111                         'name' => 'status',
112                         'vname' => 'LBL_CAMPAIGN_STATUS',
113                         'type' => 'enum',
114                         'options' => 'campaign_status_dom',
115                         'len' => 100,
116                         'audited'=>true,
117                         'comment' => 'Status of the campaign',
118                         'importable' => 'required',
119             'required' => true,
120                 ),
121                   'impressions' => array (
122                         'name' => 'impressions',
123                         'vname' => 'LBL_CAMPAIGN_IMPRESSIONS',
124                         'type' => 'int',
125                         'default'=>0,
126             'reportable'=>true,
127                         'comment' => 'Expected Click throughs manually entered by Campaign Manager'
128                 ),
129                 'currency_id' =>
130                 array (
131                 'name' => 'currency_id',
132                 'vname' => 'LBL_CURRENCY',
133                 'type' => 'id',
134                 'group'=>'currency_id',
135                 'function'=>array('name'=>'getCurrencyDropDown', 'returns'=>'html'),
136                 'required'=>false,
137                 'do_report'=>false,
138                 'reportable'=>false,
139                 'comment' => 'Currency in use for the campaign'
140                 ),
141                 'budget' => array (
142                         'name' => 'budget',
143                         'vname' => 'LBL_CAMPAIGN_BUDGET',
144                         'type' => 'currency',
145                         'dbType' => 'double',
146                         'comment' => 'Budgeted amount for the campaign'
147                 ),
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'
154                 ),
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'
161                 ),
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'
168                 ),
169                 'campaign_type' => array (
170                         'name' => 'campaign_type',
171                         'vname' => 'LBL_CAMPAIGN_TYPE',
172                         'type' => 'enum',
173                         'options' => 'campaign_type_dom',
174                         'len' => 100,
175                         'audited'=>true,
176                         'comment' => 'The type of campaign',
177                         'importable' => 'required',
178             'required' => true,
179                 ),
180                 'objective' => array (
181                         'name' => 'objective',
182                         'vname' => 'LBL_CAMPAIGN_OBJECTIVE',
183                         'type' => 'text',
184                         'comment' => 'The objective of the campaign'
185                 ),
186                 'content' => array (
187                         'name' => 'content',
188                         'vname' => 'LBL_CAMPAIGN_CONTENT',
189                         'type' => 'text',
190                         'comment' => 'The campaign description'
191                 ),
192                 'prospectlists'=> array (
193                         'name' => 'prospectlists',
194                 'type' => 'link',
195                 'relationship' => 'prospect_list_campaigns',
196                 'source'=>'non-db',
197                 ),
198                 'emailmarketing'=> array (
199                         'name' => 'emailmarketing',
200                 'type' => 'link',
201                 'relationship' => 'campaign_email_marketing',
202                 'source'=>'non-db',
203                 ),
204                 'queueitems'=> array (
205                         'name' => 'queueitems',
206                 'type' => 'link',
207                 'relationship' => 'campaign_emailman',
208                 'source'=>'non-db',
209                 ),
210                 'log_entries'=> array (
211                         'name' => 'log_entries',
212                 'type' => 'link',
213                 'relationship' => 'campaign_campaignlog',
214                 'source'=>'non-db',
215             'vname' => 'LBL_LOG_ENTRIES',
216                 ),
217                 'tracked_urls' => array (
218                         'name' => 'tracked_urls',
219                 'type' => 'link',
220                 'relationship' => 'campaign_campaigntrakers',
221                 'source'=>'non-db',
222                         'vname'=>'LBL_TRACKED_URLS',
223                 ),
224         'frequency' => array (
225             'name' => 'frequency',
226             'vname' => 'LBL_CAMPAIGN_FREQUENCY',
227             'type' => 'enum',
228             //'options' => 'campaign_status_dom',
229             'len' => 100,
230             'comment' => 'Frequency of the campaign',
231             'options' => 'newsletter_frequency_dom',
232             'len' => 100,
233         ),
234         'leads'=> array (
235             'name' => 'leads',
236             'type' => 'link',
237             'relationship' => 'campaign_leads',
238             'source'=>'non-db',
239                     'vname' => 'LBL_LEADS',
240         ),
241
242         'opportunities'=> array (
243             'name' => 'opportunities',
244             'type' => 'link',
245             'relationship' => 'campaign_opportunities',
246             'source'=>'non-db',
247                     'vname' => 'LBL_OPPORTUNITIES',
248         ),
249         'contacts'=> array (
250             'name' => 'contacts',
251             'type' => 'link',
252             'relationship' => 'campaign_contacts',
253             'source'=>'non-db',
254                     'vname' => 'LBL_CONTACTS',
255         ),
256         'accounts'=> array (
257             'name' => 'accounts',
258             'type' => 'link',
259             'relationship' => 'campaign_accounts',
260             'source'=>'non-db',
261                     'vname' => 'LBL_ACCOUNTS',
262         ),
263
264
265         ),
266         'indices' => array (
267                 array (
268                         'name' => 'camp_auto_tracker_key' ,
269                         'type'=>'index' ,
270                         'fields'=>array('tracker_key')
271                 ),
272                 array (
273                         'name' =>'idx_campaign_name',
274                         'type' =>'index',
275                         'fields'=>array('name')
276                 ),
277         ),
278
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'),
283
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'),
287
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'),
291
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'),
295
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'),
299
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'),
303
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'),
307
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'),
311
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'),
315
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'),
319                 )
320 );
321 VardefManager::createVardef('Campaigns','Campaign', array('default', 'assignable',
322 ));
323 ?>