]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Leads/metadata/convertdefs.php
Release 6.5.10
[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-2013 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     'select' => "report_to_name",
41     'default_action' => 'create',
42     'templateMeta' => array(
43         'form'=>array(
44             'hidden'=>array(
45                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
46                         '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
47                         '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
48                         '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
49                         '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
50             )
51         ),
52                 'maxColumns' => '2', 
53         'widths' => array(
54             array('label' => '10', 'field' => '30'), 
55             array('label' => '10', 'field' => '30'),
56         ),
57     ),
58     'panels' =>array (
59         'LNK_NEW_CONTACT' => array (
60             array (
61                 array (
62                     'name' => 'first_name',
63                     '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}">',
64                 ),
65                 'title',
66             ), 
67             array (
68                 
69                 'last_name',
70                 'department',
71             ),
72             array (
73                 array('name' => 'primary_address_street', 'label' => 'LBL_PRIMARY_ADDRESS'),
74                 'phone_work',
75                 
76             ),
77             array (
78                 array('name'=>'primary_address_state', 'label' => 'LBL_STATE'),
79                 'phone_mobile',
80             ),
81             array (
82                 array('name'=>'primary_address_postalcode', 'label' => 'LBL_POSTAL_CODE'),
83                 'phone_other',
84             ),
85             array (
86                 array('name'=>'primary_address_country', 'label' => 'LBL_COUNTRY'),
87                 'phone_fax',
88             ),
89             array (
90                 'email1',
91                 'lead_source',
92             ),
93             array(
94                 'description'
95             ),
96         )
97     ),
98 );
99 $viewdefs['Accounts']['ConvertLead'] = array(
100     'copyData' => true,
101     'required' => true,
102     'select' => "account_name",
103         'default_action' => 'create',
104     'relationship' => 'accounts_contacts',
105     'templateMeta' => array(
106         'form'=>array(
107             'hidden'=>array(
108                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
109                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
110                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
111                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
112                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
113             )
114         ),
115         'maxColumns' => '2', 
116         'widths' => array(
117             array('label' => '10', 'field' => '30'), 
118             array('label' => '10', 'field' => '30'),
119         ),
120     ),
121     'panels' =>array (
122         'LNK_NEW_ACCOUNT' => array (
123             array (
124                 'name',
125                 'phone_office',
126             ),
127             array (
128                 'website',
129             ),
130             array(
131                 'description'
132             ),
133         )
134     ),
135 );
136 $viewdefs['Opportunities']['ConvertLead'] = array(
137     'copyData' => true,
138     'required' => false,
139     'templateMeta' => array(
140         'form'=>array(
141             'hidden'=>array(
142             )
143         ),
144         'maxColumns' => '2', 
145         'widths' => array(
146             array('label' => '10', 'field' => '30'), 
147             array('label' => '10', 'field' => '30'),
148         ),
149     ),
150     'panels' =>array (
151         'LNK_NEW_OPPORTUNITY' => array (
152             array (
153                 'name',
154                 'currency_id'
155             ), 
156             array (
157                 'sales_stage',
158                 'amount'
159             ),
160             array (
161                 'date_closed',
162                 ''
163             ),
164             array (
165                 'description'
166             ),
167         )
168     ),
169 );
170 $viewdefs['Notes']['ConvertLead'] = array(
171     'copyData' => false,
172     'required' => false,
173     'templateMeta' => array(
174         'form'=>array(
175             'hidden'=>array(
176                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
177                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
178                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
179                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
180                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
181             )
182         ),
183         'maxColumns' => '2', 
184         'widths' => array(
185             array('label' => '10', 'field' => '30'), 
186             array('label' => '10', 'field' => '30'),    
187         ),
188     ),
189     'panels' =>array (
190         'LNK_NEW_NOTE' => array (
191             array (
192                 array('name'=>'name', 'displayParams'=>array('size'=>90)),
193             ), 
194             array (
195                 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
196             ),
197         )
198     ),
199 );
200
201 $viewdefs['Calls']['ConvertLead'] = array(
202     'copyData' => false,
203     'required' => false,
204     'templateMeta' => array(
205         'form'=>array(
206             'hidden'=>array(
207                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
208                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
209                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
210                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
211                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">',
212                 '<input type="hidden" name="Callsstatus" value="{sugar_translate label=\'call_status_default\'}">',
213             )
214         ),
215         'maxColumns' => '2', 
216         'widths' => array(
217             array('label' => '10', 'field' => '30'), 
218             array('label' => '10', 'field' => '30'),
219         ),
220     ),
221     'panels' =>array (
222         'LNK_NEW_CALL' => array (
223             array (
224                 array('name'=>'name', 'displayParams'=>array('size'=>90)),
225             ), 
226             array (
227                'date_start', 
228                 array (
229                     'name' => 'duration_hours',
230                     'label' => 'LBL_DURATION',
231                     'customCode' => '{literal}
232 <script type="text/javascript">
233     function isValidCallsDuration() { 
234         form = document.getElementById(\'ConvertLead\');
235         if ( form.duration_hours.value + form.duration_minutes.value <= 0 ) {
236             alert(\'{/literal}{sugar_translate label="NOTICE_DURATION_TIME" module="Calls"}{literal}\'); 
237             return false;
238         }
239         return true; 
240     }
241 </script>{/literal}
242 <input name="Callsduration_hours" tabindex="1" size="2" maxlength="2" type="text" value="{$fields.duration_hours.value}"/>
243 {php}$this->_tpl_vars["minutes_values"] = $this->_tpl_vars["bean"]->minutes_values;{/php}
244 {html_options name="Callsduration_minutes" options=$minutes_values selected=$fields.duration_minutes.value} &nbsp;
245 <span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
246                     'displayParams' => 
247                     array (
248                       'required' => true,
249                     ),
250                 ),
251             ),
252             array (
253                 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
254             ),
255         )
256     ),
257 );
258
259 $viewdefs['Meetings']['ConvertLead'] = array(
260     'copyData' => false,
261     'required' => false,
262     'relationship' => 'meetings_users',
263     'templateMeta' => array(
264         'form'=>array(
265             'hidden'=>array(
266                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
267                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
268                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
269                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
270                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">',
271                 '<input type="hidden" name="Meetingsstatus" value="{sugar_translate label=\'meeting_status_default\'}">',
272             )
273         ),
274         'maxColumns' => '2', 
275         'widths' => array(
276             array('label' => '10', 'field' => '30'), 
277             array('label' => '10', 'field' => '30'),
278         ),
279     ),
280     'panels' =>array (
281         'LNK_NEW_MEETING' => array (
282             array (
283                 array('name'=>'name', 'displayParams'=>array('size'=>90)),
284             ), 
285             array (
286                'date_start', 
287                     array (
288                     'name' => 'duration_hours',
289                     'label' => 'LBL_DURATION',
290                     'customCode' => '{literal}
291 <script type="text/javascript">
292     function isValidMeetingsDuration() { 
293         form = document.getElementById(\'ConvertLead\');
294         if ( form.duration_hours.value + form.duration_minutes.value <= 0 ) {
295             alert(\'{/literal}{sugar_translate label="NOTICE_DURATION_TIME" module="Calls"}{literal}\'); 
296             return false;
297         }
298         return true; 
299     }
300 </script>{/literal}
301 <input name="Meetingsduration_hours" tabindex="1" size="2" maxlength="2" type="text" value="{$fields.duration_hours.value}" />
302 {php}$this->_tpl_vars["minutes_values"] = $this->_tpl_vars["bean"]->minutes_values;{/php}
303 {html_options name="Meetingsduration_minutes" options=$minutes_values selected=$fields.duration_minutes.value} &nbsp;
304 <span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
305                     'displayParams' => 
306                     array (
307                       'required' => true,
308                     ),
309                 ),
310             ),
311             array (
312                 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
313             ),
314         )
315     ),
316 );
317
318 $viewdefs['Tasks']['ConvertLead'] = array(
319     'copyData' => false,
320     'required' => false,
321     'templateMeta' => array(
322         'form'=>array(
323             'hidden'=>array(
324                 '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
325                 '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
326                 '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
327                 '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
328                 '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
329             )
330         ),
331         'maxColumns' => '2', 
332         'widths' => array(
333             array('label' => '10', 'field' => '30'), 
334             array('label' => '10', 'field' => '30'),
335         ),
336     ),
337     'panels' =>array (
338         'LNK_NEW_TASK' => array (
339             array (
340                 array('name'=>'name', 'displayParams'=>array('size'=>90)),
341             ), 
342                         array (
343                'status', 'priority'
344             ), 
345             
346             array (
347                 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
348             ),
349         )
350     ),
351 );
352
353
354 ?>