]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/SugarObjects/templates/company/vardefs.php
Release 6.5.0
[Github/sugarcrm.git] / include / SugarObjects / templates / company / 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 $vardefs= array (  
39 'fields' => array (
40    'name' => 
41   array (
42     'name' => 'name',
43     'type' => 'name',
44     'dbType' => 'varchar',
45     'vname' => 'LBL_NAME',
46     'len' => 150,
47     'comment' => 'Name of the Company',
48     'unified_search' => true,
49     'full_text_search' => array('boost' => 3),
50     'audited' => true,
51         'required'=>true,
52     'importable' => 'required',
53     'merge_filter' => 'selected',  //field will be enabled for merge and will be a part of the default search criteria..other valid values for this property are enabled and disabled, default value is disabled.
54                             //property value is case insensitive.
55   ),
56    
57    strtolower($object_name).'_type' => 
58   array (
59     'name' => strtolower($object_name).'_type',
60     'vname' => 'LBL_TYPE',
61     'type' => 'enum',
62     'options' => strtolower($object_name).'_type_dom',
63     'len'=>50,
64     'comment' => 'The Company is of this type',
65   ),  
66 'industry' => 
67   array (
68     'name' => 'industry',
69     'vname' => 'LBL_INDUSTRY',
70     'type' => 'enum',
71     'options' => 'industry_dom',
72     'len'=>50,
73     'comment' => 'The company belongs in this industry',
74     'merge_filter' => 'enabled',
75   ),
76     'annual_revenue' => 
77   array (
78     'name' => 'annual_revenue',
79     'vname' => 'LBL_ANNUAL_REVENUE',
80     'type' => 'varchar',
81     'len' => 100,
82     'comment' => 'Annual revenue for this company',
83     'merge_filter' => 'enabled',
84   ),
85   'phone_fax' => 
86   array (
87     'name' => 'phone_fax',
88     'vname' => 'LBL_FAX',
89     'type' => 'phone',
90     'dbType' => 'varchar',
91     'len' => 100,
92     'unified_search' => true,
93     'full_text_search' => array('boost' => 1),
94     'comment' => 'The fax phone number of this company',
95   ), 
96   
97   'billing_address_street' => 
98   array (
99     'name' => 'billing_address_street',
100     'vname' => 'LBL_BILLING_ADDRESS_STREET',
101     'type' => 'varchar',
102     'len' => '150',
103     'comment' => 'The street address used for billing address',
104     'group'=>'billing_address',
105     'merge_filter' => 'enabled',
106   ),
107   'billing_address_street_2' => 
108   array (
109     'name' => 'billing_address_street_2',
110     'vname' => 'LBL_BILLING_ADDRESS_STREET_2',
111     'type' => 'varchar',
112     'len' => '150',
113     'source'=>'non-db',
114   ),
115   'billing_address_street_3' => 
116   array (
117     'name' => 'billing_address_street_3',
118     'vname' => 'LBL_BILLING_ADDRESS_STREET_3',
119     'type' => 'varchar',
120     'len' => '150',
121     'source'=>'non-db',
122   ),
123   'billing_address_street_4' => 
124   array (
125     'name' => 'billing_address_street_4',
126     'vname' => 'LBL_BILLING_ADDRESS_STREET_4',
127     'type' => 'varchar',
128     'len' => '150',
129     'source'=>'non-db',
130   ),
131   'billing_address_city' => 
132   array (
133     'name' => 'billing_address_city',
134     'vname' => 'LBL_BILLING_ADDRESS_CITY',
135     'type' => 'varchar',
136     'len' => '100',
137     'comment' => 'The city used for billing address',
138     'group'=>'billing_address',
139     'merge_filter' => 'enabled',
140   ),
141   'billing_address_state' => 
142   array (
143     'name' => 'billing_address_state',
144     'vname' => 'LBL_BILLING_ADDRESS_STATE',
145     'type' => 'varchar',
146     'len' => '100',
147     'group'=>'billing_address',
148     'comment' => 'The state used for billing address',
149     'merge_filter' => 'enabled',
150   ),
151   'billing_address_postalcode' => 
152   array (
153     'name' => 'billing_address_postalcode',
154     'vname' => 'LBL_BILLING_ADDRESS_POSTALCODE',
155     'type' => 'varchar',
156     'len' => '20',
157     'group'=>'billing_address',
158     'comment' => 'The postal code used for billing address',
159     'merge_filter' => 'enabled',
160     
161   ),
162   'billing_address_country' => 
163   array (
164     'name' => 'billing_address_country',
165     'vname' => 'LBL_BILLING_ADDRESS_COUNTRY',
166     'type' => 'varchar',
167     'group'=>'billing_address',
168     'comment' => 'The country used for the billing address',
169     'merge_filter' => 'enabled',
170   ),
171    'rating' => 
172   array (
173     'name' => 'rating',
174     'vname' => 'LBL_RATING',
175     'type' => 'varchar',
176     'len' => 100,
177     'comment' => 'An arbitrary rating for this company for use in comparisons with others',
178   ),
179     'phone_office' => 
180   array (
181     'name' => 'phone_office',
182     'vname' => 'LBL_PHONE_OFFICE',
183     'type' => 'phone',
184     'dbType' => 'varchar',
185     'len' => 100,
186     'audited'=>true,
187     'unified_search' => true,  
188     'full_text_search' => array('boost' => 1),
189     'comment' => 'The office phone number',
190     'merge_filter' => 'enabled',
191   ),
192     'phone_alternate' => 
193   array (
194     'name' => 'phone_alternate',
195     'vname' => 'LBL_PHONE_ALT',
196     'type' => 'phone',
197     'group'=>'phone_office',
198     'dbType' => 'varchar',
199     'len' => 100,
200     'unified_search' => true,
201     'full_text_search' => array('boost' => 1),
202     'comment' => 'An alternate phone number',
203     'merge_filter' => 'enabled',
204   ),
205    'website' => 
206   array (
207     'name' => 'website',
208     'vname' => 'LBL_WEBSITE',
209     'type' => 'url',
210     'dbType' => 'varchar',
211     'len' => 255,
212     'comment' => 'URL of website for the company',
213   ),
214    'ownership' => 
215   array (
216     'name' => 'ownership',
217     'vname' => 'LBL_OWNERSHIP',
218     'type' => 'varchar',
219     'len' => 100,
220     'comment' => '',
221   ),
222    'employees' => 
223   array (
224     'name' => 'employees',
225     'vname' => 'LBL_EMPLOYEES',
226     'type' => 'varchar',
227     'len' => 10,
228     'comment' => 'Number of employees, varchar to accomodate for both number (100) or range (50-100)',
229   ),
230   'ticker_symbol' => 
231   array (
232     'name' => 'ticker_symbol',
233     'vname' => 'LBL_TICKER_SYMBOL',
234     'type' => 'varchar',
235     'len' => 10,
236     'comment' => 'The stock trading (ticker) symbol for the company',
237     'merge_filter' => 'enabled',
238   ),
239   'shipping_address_street' => 
240   array (
241     'name' => 'shipping_address_street',
242     'vname' => 'LBL_SHIPPING_ADDRESS_STREET',
243     'type' => 'varchar',
244     'len' => 150,
245     'group'=>'shipping_address',
246     'comment' => 'The street address used for for shipping purposes',
247     'merge_filter' => 'enabled',
248   ),
249   'shipping_address_street_2' => 
250   array (
251     'name' => 'shipping_address_street_2',
252     'vname' => 'LBL_SHIPPING_ADDRESS_STREET_2',
253     'type' => 'varchar',
254     'len' => 150,
255     'source'=>'non-db',
256   ),
257   'shipping_address_street_3' => 
258   array (
259     'name' => 'shipping_address_street_3',
260     'vname' => 'LBL_SHIPPING_ADDRESS_STREET_3',
261     'type' => 'varchar',
262     'len' => 150,
263     'source'=>'non-db',
264   ),
265   'shipping_address_street_4' => 
266   array (
267     'name' => 'shipping_address_street_4',
268     'vname' => 'LBL_SHIPPING_ADDRESS_STREET_4',
269     'type' => 'varchar',
270     'len' => 150,
271     'source'=>'non-db',
272   ),    
273   'shipping_address_city' => 
274   array (
275     'name' => 'shipping_address_city',
276     'vname' => 'LBL_SHIPPING_ADDRESS_CITY',
277     'type' => 'varchar',
278     'len' => 100,
279     'group'=>'shipping_address',
280     'comment' => 'The city used for the shipping address',
281     'merge_filter' => 'enabled',
282   ),
283   'shipping_address_state' => 
284   array (
285     'name' => 'shipping_address_state',
286     'vname' => 'LBL_SHIPPING_ADDRESS_STATE',
287     'type' => 'varchar',
288     'len' => 100,
289     'group'=>'shipping_address',
290     'comment' => 'The state used for the shipping address',
291     'merge_filter' => 'enabled',
292   ),
293   'shipping_address_postalcode' => 
294   array (
295     'name' => 'shipping_address_postalcode',
296     'vname' => 'LBL_SHIPPING_ADDRESS_POSTALCODE',
297     'type' => 'varchar',
298     'len' => 20,
299     'group'=>'shipping_address',
300     'comment' => 'The zip code used for the shipping address',
301     'merge_filter' => 'enabled',
302   ),
303   'shipping_address_country' => 
304   array (
305     'name' => 'shipping_address_country',
306     'vname' => 'LBL_SHIPPING_ADDRESS_COUNTRY',
307     'type' => 'varchar',
308     'group'=>'shipping_address',
309     'comment' => 'The country used for the shipping address',
310     'merge_filter' => 'enabled',
311   ),
312   
313   
314 'email1' => array(
315         'name'          => 'email1',
316         'vname'         => 'LBL_EMAIL',
317         'group'=>'email1',
318         'type'          => 'varchar',
319         'function'      => array(
320         'name'          => 'getEmailAddressWidget',
321            'returns'    => 'html'
322     ),
323         'source'        => 'non-db',
324     'studio' => array('editField' => true, 'searchview' => false),
325 ), 
326   
327   'email_addresses_primary' => 
328   array (
329     'name' => 'email_addresses_primary',
330     'type' => 'link',
331     'relationship' => strtolower($object_name).'_email_addresses_primary',
332     'source' => 'non-db',
333     'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
334     'duplicate_merge' => 'disabled',
335   ),  
336   
337   'email_addresses' =>
338     array (
339         'name' => 'email_addresses',
340         'type' => 'link',
341         'relationship' => strtolower($object_name).'_email_addresses',
342         'source' => 'non-db',
343         'vname' => 'LBL_EMAIL_ADDRESSES',
344         'reportable'=>false,
345         'unified_search' => true,
346         'rel_fields' => array('primary_address' => array('type'=>'bool')),
347     ),
348 ),
349 'relationships'=>array(
350     strtolower($module).'_email_addresses' => 
351     array(
352         'lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
353         'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
354         'relationship_type'=>'many-to-many',
355         'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id', 
356         'relationship_role_column'=>'bean_module',
357         'relationship_role_column_value'=>$module
358     ),
359     strtolower($module).'_email_addresses_primary' => 
360     array('lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
361         'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
362         'relationship_type'=>'many-to-many',
363         'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id', 
364         'relationship_role_column'=>'primary_address', 
365         'relationship_role_column_value'=>'1'
366     ),
367 )
368 );