2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
37 $viewdefs['Contacts']['ConvertLead'] = array(
40 'select' => "report_to_name",
41 'default_action' => 'create',
42 'templateMeta' => 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}">'
54 array('label' => '10', 'field' => '30'),
55 array('label' => '10', 'field' => '30'),
59 'LNK_NEW_CONTACT' => array (
62 'name' => 'first_name',
63 'customCode' => '{html_options name="Contactssalutation" options=$fields.salutation.options selected=$fields.salutation.value} <input name="Contactsfirst_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
73 array('name' => 'primary_address_street', 'label' => 'LBL_PRIMARY_ADDRESS'),
78 array('name'=>'primary_address_state', 'label' => 'LBL_STATE'),
82 array('name'=>'primary_address_postalcode', 'label' => 'LBL_POSTAL_CODE'),
86 array('name'=>'primary_address_country', 'label' => 'LBL_COUNTRY'),
99 $viewdefs['Accounts']['ConvertLead'] = array(
102 'select' => "account_name",
103 'default_action' => 'create',
104 'relationship' => 'accounts_contacts',
105 'templateMeta' => 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}">'
117 array('label' => '10', 'field' => '30'),
118 array('label' => '10', 'field' => '30'),
122 'LNK_NEW_ACCOUNT' => array (
136 $viewdefs['Opportunities']['ConvertLead'] = array(
139 'templateMeta' => array(
146 array('label' => '10', 'field' => '30'),
147 array('label' => '10', 'field' => '30'),
151 'LNK_NEW_OPPORTUNITY' => array (
170 $viewdefs['Notes']['ConvertLead'] = array(
173 'templateMeta' => 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}">'
185 array('label' => '10', 'field' => '30'),
186 array('label' => '10', 'field' => '30'),
190 'LNK_NEW_NOTE' => array (
192 array('name'=>'name', 'displayParams'=>array('size'=>90)),
195 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
201 $viewdefs['Calls']['ConvertLead'] = array(
204 'templateMeta' => 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\'}">',
217 array('label' => '10', 'field' => '30'),
218 array('label' => '10', 'field' => '30'),
222 'LNK_NEW_CALL' => array (
224 array('name'=>'name', 'displayParams'=>array('size'=>90)),
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}\');
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}
245 <span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
253 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
259 $viewdefs['Meetings']['ConvertLead'] = array(
262 'relationship' => 'meetings_users',
263 'templateMeta' => 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\'}">',
276 array('label' => '10', 'field' => '30'),
277 array('label' => '10', 'field' => '30'),
281 'LNK_NEW_MEETING' => array (
283 array('name'=>'name', 'displayParams'=>array('size'=>90)),
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}\');
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}
304 <span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
312 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
318 $viewdefs['Tasks']['ConvertLead'] = array(
321 'templateMeta' => 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}">'
333 array('label' => '10', 'field' => '30'),
334 array('label' => '10', 'field' => '30'),
338 'LNK_NEW_TASK' => array (
340 array('name'=>'name', 'displayParams'=>array('size'=>90)),
347 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),