2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 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 'templateMeta' => 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}">'
52 array('label' => '10', 'field' => '30'),
53 array('label' => '10', 'field' => '30'),
57 'LNK_NEW_CONTACT' => array (
60 'name' => 'first_name',
61 '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}">',
71 array('name' => 'primary_address_street', 'label' => 'LBL_PRIMARY_ADDRESS'),
76 array('name'=>'primary_address_state', 'label' => 'LBL_STATE'),
80 array('name'=>'primary_address_postalcode', 'label' => 'LBL_POSTAL_CODE'),
84 array('name'=>'primary_address_country', 'label' => 'LBL_COUNTRY'),
97 $viewdefs['Accounts']['ConvertLead'] = array(
100 'select' => "account_name",
101 'default_action' => 'create',
102 'relationship' => 'accounts_contacts',
103 'templateMeta' => 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}">'
115 array('label' => '10', 'field' => '30'),
116 array('label' => '10', 'field' => '30'),
120 'LNK_NEW_ACCOUNT' => array (
134 $viewdefs['Opportunities']['ConvertLead'] = array(
137 'templateMeta' => array(
144 array('label' => '10', 'field' => '30'),
145 array('label' => '10', 'field' => '30'),
149 'LNK_NEW_OPPORTUNITY' => array (
168 $viewdefs['Notes']['ConvertLead'] = array(
171 'templateMeta' => 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}">'
183 array('label' => '10', 'field' => '30'),
184 array('label' => '10', 'field' => '30'),
188 'LNK_NEW_NOTE' => array (
190 array('name'=>'name', 'displayParams'=>array('size'=>90)),
193 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
199 $viewdefs['Calls']['ConvertLead'] = array(
202 'templateMeta' => 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\'}">',
215 array('label' => '10', 'field' => '30'),
216 array('label' => '10', 'field' => '30'),
220 'LNK_NEW_CALL' => array (
222 array('name'=>'name', 'displayParams'=>array('size'=>90)),
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}\');
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}
243 <span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
251 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
257 $viewdefs['Meetings']['ConvertLead'] = array(
260 'relationship' => 'meetings_users',
261 'templateMeta' => 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\'}">',
274 array('label' => '10', 'field' => '30'),
275 array('label' => '10', 'field' => '30'),
279 'LNK_NEW_MEETING' => array (
281 array('name'=>'name', 'displayParams'=>array('size'=>90)),
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}\');
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}
302 <span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
310 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
316 $viewdefs['Tasks']['ConvertLead'] = array(
319 'templateMeta' => 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}">'
331 array('label' => '10', 'field' => '30'),
332 array('label' => '10', 'field' => '30'),
336 'LNK_NEW_TASK' => array (
338 array('name'=>'name', 'displayParams'=>array('size'=>90)),
345 array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),