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