]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Leads/metadata/convertdefs.php
Release 6.5.0
[Github/sugarcrm.git] / modules / Leads / metadata / convertdefs.php
1 <?php
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
5  * 
6  * This program is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  * 
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
16  * details.
17  * 
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  * 
23  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
25  * 
26  * The interactive user interfaces in modified source and object code versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  * 
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the "Powered by
32  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33  * technical reasons, the Appropriate Legal Notices must display the words
34  * "Powered by SugarCRM".
35  ********************************************************************************/
36
37 $viewdefs['Contacts']['ConvertLead'] = array(
38     'copyData' => true,
39     'required' => true,
40     'templateMeta' => array(
41         'form'=>array(
42             'hidden'=>array(
43                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
44                         '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
45                         '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
46                         '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
47                         '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
48             )
49         ),
50                 'maxColumns' => '2', 
51         'widths' => array(
52             array('label' => '10', 'field' => '30'), 
53             array('label' => '10', 'field' => '30'),
54         ),
55     ),
56     'panels' =>array (
57         'LNK_NEW_CONTACT' => array (
58             array (
59                 array (
60                     'name' => 'first_name',
61                     'customCode' => '{html_options name="Contactssalutation" options=$fields.salutation.options selected=$fields.salutation.value}&nbsp;<input name="Contactsfirst_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
62                 ),
63                 'title',
64             ), 
65             array (
66                 
67                 'last_name',
68                 'department',
69             ),
70             array (
71                 array('name' => 'primary_address_street', 'label' => 'LBL_PRIMARY_ADDRESS'),
72                 'phone_work',
73                 
74             ),
75             array (
76                 array('name'=>'primary_address_state', 'label' => 'LBL_STATE'),
77                 'phone_mobile',
78             ),
79             array (
80                 array('name'=>'primary_address_postalcode', 'label' => 'LBL_POSTAL_CODE'),
81                 'phone_other',
82             ),
83             array (
84                 array('name'=>'primary_address_country', 'label' => 'LBL_COUNTRY'),
85                 'phone_fax',
86             ),
87             array (
88                 'email1',
89                 'lead_source',
90             ),
91             array(
92                 'description'
93             ),
94         )
95     ),
96 );
97 $viewdefs['Accounts']['ConvertLead'] = array(
98     'copyData' => true,
99     'required' => true,
100     'select' => "account_name",
101         'default_action' => 'create',
102     'relationship' => 'accounts_contacts',
103     'templateMeta' => array(
104         'form'=>array(
105             'hidden'=>array(
106                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
107                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
108                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
109                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
110                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
111             )
112         ),
113         'maxColumns' => '2', 
114         'widths' => array(
115             array('label' => '10', 'field' => '30'), 
116             array('label' => '10', 'field' => '30'),
117         ),
118     ),
119     'panels' =>array (
120         'LNK_NEW_ACCOUNT' => array (
121             array (
122                 'name',
123                 'phone_office',
124             ),
125             array (
126                 'website',
127             ),
128             array(
129                 'description'
130             ),
131         )
132     ),
133 );
134 $viewdefs['Opportunities']['ConvertLead'] = array(
135     'copyData' => true,
136     'required' => false,
137     'templateMeta' => array(
138         'form'=>array(
139             'hidden'=>array(
140             )
141         ),
142         'maxColumns' => '2', 
143         'widths' => array(
144             array('label' => '10', 'field' => '30'), 
145             array('label' => '10', 'field' => '30'),
146         ),
147     ),
148     'panels' =>array (
149         'LNK_NEW_OPPORTUNITY' => array (
150             array (
151                 'name',
152                 'currency_id'
153             ), 
154             array (
155                 'sales_stage',
156                 'amount'
157             ),
158             array (
159                 'date_closed',
160                 ''
161             ),
162             array (
163                 'description'
164             ),
165         )
166     ),
167 );
168 $viewdefs['Notes']['ConvertLead'] = array(
169     'copyData' => false,
170     'required' => false,
171     'templateMeta' => array(
172         'form'=>array(
173             'hidden'=>array(
174                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
175                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
176                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
177                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
178                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
179             )
180         ),
181         'maxColumns' => '2', 
182         'widths' => array(
183             array('label' => '10', 'field' => '30'), 
184             array('label' => '10', 'field' => '30'),    
185         ),
186     ),
187     'panels' =>array (
188         'LNK_NEW_NOTE' => array (
189             array (
190                 array('name'=>'name', 'displayParams'=>array('size'=>90)),
191             ), 
192             array (
193                 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
194             ),
195         )
196     ),
197 );
198
199 $viewdefs['Calls']['ConvertLead'] = array(
200     'copyData' => false,
201     'required' => false,
202     'templateMeta' => array(
203         'form'=>array(
204             'hidden'=>array(
205                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
206                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
207                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
208                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
209                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">',
210                 '<input type="hidden" name="Callsstatus" value="{sugar_translate label=\'call_status_default\'}">',
211             )
212         ),
213         'maxColumns' => '2', 
214         'widths' => array(
215             array('label' => '10', 'field' => '30'), 
216             array('label' => '10', 'field' => '30'),
217         ),
218     ),
219     'panels' =>array (
220         'LNK_NEW_CALL' => array (
221             array (
222                 array('name'=>'name', 'displayParams'=>array('size'=>90)),
223             ), 
224             array (
225                'date_start', 
226                 array (
227                     'name' => 'duration_hours',
228                     'label' => 'LBL_DURATION',
229                     'customCode' => '{literal}
230 <script type="text/javascript">
231     function isValidCallsDuration() { 
232         form = document.getElementById(\'ConvertLead\');
233         if ( form.duration_hours.value + form.duration_minutes.value <= 0 ) {
234             alert(\'{/literal}{sugar_translate label="NOTICE_DURATION_TIME" module="Calls"}{literal}\'); 
235             return false;
236         }
237         return true; 
238     }
239 </script>{/literal}
240 <input name="Callsduration_hours" tabindex="1" size="2" maxlength="2" type="text" value="{$fields.duration_hours.value}"/>
241 {php}$this->_tpl_vars["minutes_values"] = $this->_tpl_vars["bean"]->minutes_values;{/php}
242 {html_options name="Callsduration_minutes" options=$minutes_values selected=$fields.duration_minutes.value} &nbsp;
243 <span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
244                     'displayParams' => 
245                     array (
246                       'required' => true,
247                     ),
248                 ),
249             ),
250             array (
251                 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
252             ),
253         )
254     ),
255 );
256
257 $viewdefs['Meetings']['ConvertLead'] = array(
258     'copyData' => false,
259     'required' => false,
260     'relationship' => 'meetings_users',
261     'templateMeta' => array(
262         'form'=>array(
263             'hidden'=>array(
264                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
265                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
266                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
267                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
268                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">',
269                 '<input type="hidden" name="Meetingsstatus" value="{sugar_translate label=\'meeting_status_default\'}">',
270             )
271         ),
272         'maxColumns' => '2', 
273         'widths' => array(
274             array('label' => '10', 'field' => '30'), 
275             array('label' => '10', 'field' => '30'),
276         ),
277     ),
278     'panels' =>array (
279         'LNK_NEW_MEETING' => array (
280             array (
281                 array('name'=>'name', 'displayParams'=>array('size'=>90)),
282             ), 
283             array (
284                'date_start', 
285                     array (
286                     'name' => 'duration_hours',
287                     'label' => 'LBL_DURATION',
288                     'customCode' => '{literal}
289 <script type="text/javascript">
290     function isValidMeetingsDuration() { 
291         form = document.getElementById(\'ConvertLead\');
292         if ( form.duration_hours.value + form.duration_minutes.value <= 0 ) {
293             alert(\'{/literal}{sugar_translate label="NOTICE_DURATION_TIME" module="Calls"}{literal}\'); 
294             return false;
295         }
296         return true; 
297     }
298 </script>{/literal}
299 <input name="Meetingsduration_hours" tabindex="1" size="2" maxlength="2" type="text" value="{$fields.duration_hours.value}" />
300 {php}$this->_tpl_vars["minutes_values"] = $this->_tpl_vars["bean"]->minutes_values;{/php}
301 {html_options name="Meetingsduration_minutes" options=$minutes_values selected=$fields.duration_minutes.value} &nbsp;
302 <span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
303                     'displayParams' => 
304                     array (
305                       'required' => true,
306                     ),
307                 ),
308             ),
309             array (
310                 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
311             ),
312         )
313     ),
314 );
315
316 $viewdefs['Tasks']['ConvertLead'] = array(
317     'copyData' => false,
318     'required' => false,
319     'templateMeta' => array(
320         'form'=>array(
321             'hidden'=>array(
322                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
323                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
324                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
325                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
326                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
327             )
328         ),
329         'maxColumns' => '2', 
330         'widths' => array(
331             array('label' => '10', 'field' => '30'), 
332             array('label' => '10', 'field' => '30'),
333         ),
334     ),
335     'panels' =>array (
336         'LNK_NEW_TASK' => array (
337             array (
338                 array('name'=>'name', 'displayParams'=>array('size'=>90)),
339             ), 
340                         array (
341                'status', 'priority'
342             ), 
343             
344             array (
345                 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
346             ),
347         )
348     ),
349 );
350
351
352 ?>