]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Leads/tpls/ConvertLead.tpl
Release 6.5.0
[Github/sugarcrm.git] / modules / Leads / tpls / ConvertLead.tpl
1 {*
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 *}
38
39 <span class="color">{$ERROR}</span>
40 {{foreach name=section from=$sectionPanels key=label item=panel}}
41 {{counter name="panelCount" print=false}}
42 <h4>
43 <style>
44  input[disabled] {ldelim}
45     background-color:lightgray;
46  {rdelim}
47 </style>
48 <table><tr><td>
49 <input type="hidden" name="convert_create_{{$module}}" id="convert_create_{{$module}}" 
50     {if ($def.required && empty($def.select)) || (!empty($def.default_action) && $def.default_action == "create")} value="true" {/if}/>
51
52 {{if isset($def.templateMeta.form.hidden)}}
53 {{foreach from=$def.templateMeta.form.hidden item=field}}
54 {{$field}}   
55 {{/foreach}}
56 {{/if}}
57 {if !$def.required || !empty($def.select)}
58 <input class="checkbox" type="checkbox" name="new{{$module}}" id="new{{$module}}" onclick="toggleDisplay('create{{$module}}');if (typeof(addRemoveDropdownElement) == 'function') addRemoveDropdownElement('{{$module}}');{{if !empty($def.select)}}toggle{{$module}}Select();{{/if}}">
59 <script type="text/javascript">
60  {{if !empty($def.select)}}
61  toggle{{$module}}Select = function(){ldelim} 
62     var inputs = document.getElementById('select{{$module}}').getElementsByTagName('input');
63         for(var i in inputs) {ldelim}inputs[i].disabled = !inputs[i].disabled;{rdelim}
64         var buttons = document.getElementById('select{{$module}}').getElementsByTagName('button');
65     for(var i in buttons) {ldelim}buttons[i].disabled = !buttons[i].disabled;{rdelim}
66  {rdelim}
67  {{/if}}
68  {if !empty($def.default_action) && $def.default_action == "create"}
69      {if $lead_conv_activity_opt == 'move' || $lead_conv_activity_opt == 'copy' || $lead_conv_activity_opt == ''}
70         YAHOO.util.Event.onContentReady('lead_conv_ac_op_sel', function(){ldelim}
71      {else}
72         YAHOO.util.Event.onContentReady('create{{$module}}', function(){ldelim}
73      {/if}
74                 toggleDisplay('create{{$module}}');
75                 document.getElementById('new{{$module}}').checked = true;
76                 if (typeof(addRemoveDropdownElement) == 'function')
77                     addRemoveDropdownElement('{{$module}}');
78                 {{if !empty($def.select)}}
79                 toggle{{$module}}Select();
80                 {{/if}}
81         {rdelim});
82  {/if}
83 {/if}
84 </script>
85 </td><td>
86 {sugar_translate label='{{$label}}' module='Leads'}
87 </td><td>
88 {{if !empty($def.select)}}
89     {sugar_translate label='LNK_SELECT_{{$module|strtoupper}}' module='Leads'}
90     {if $def.required }
91         <span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
92     {/if}
93 </td><td id ="select{{$module}}">
94 {{sugar_field parentFieldArray='contact_def' vardef=$contact_def[$def.select] displayType='EditView' formName=$form_name call_back_function='set_return_lead_conv'}}
95 <script>
96 if (typeof(sqs_objects) == "undefined") sqs_objects = [];
97 sqs_objects['{{$form_name}}_{{$def.select}}'] = {ldelim}
98     form          : '{{$form_name}}',
99     method        : 'query',
100     modules       : ['{{$module}}'],
101     group         : 'or',
102     field_list    : ['name', 'id'],
103     populate_list : ['{{$def.select}}', '{{$contact_def[$def.select].id_name}}'],
104     conditions    : [{ldelim}'name':'name','op':'like','end':'%','value':''{rdelim}],
105     required_list : ['{{$contact_def[$def.select].id_name}}'],
106     order         : 'name',
107     limit         : '10'
108 {rdelim}
109 </script>
110 {{/if}}
111 </td></tr></table>
112 </h4>
113 <table width="100%" border="0" cellspacing="1" cellpadding="0"  class="{$def.templateMeta.panelClass|default:'edit view'}" id ="create{{$module}}" {if !$def.required || !empty($def.select)}style="display:none"{/if}>
114 {{assign var='rowCount' value=0}}
115 {{foreach name=rowIteration from=$panel key=row item=rowData}}
116     <tr>
117     {{assign var='columnsInRow' value=$rowData|@count}}
118     {{assign var='columnsUsed' value=0}}
119
120     {{* Loop through each column and display *}}
121     {{counter name="colCount" start=0 print=false assign="colCount"}}
122
123     {{foreach name=colIteration from=$rowData key=col item=colData}}
124             {{counter name="colCount" print=false}}
125             {{if count($rowData) == $colCount}}
126                 {{assign var="colCount" value=0}}
127             {{/if}}
128         {{if empty($def.templateMeta.labelsOnTop) && empty($colData.field.hideLabel)}}
129         <td valign="top" id='{{$colData.field.name}}_label' width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' scope="row">
130             {{if isset($colData.field.customLabel)}}
131                {{$colData.field.customLabel}}
132             {{elseif isset($colData.field.label)}}
133                {capture name="label" assign="label"}
134                {sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}
135                {/capture}
136                {$label|strip_semicolon}:
137             {{elseif isset($fields[$colData.field.name])}}
138                {capture name="label" assign="label"}
139                {sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}
140                {/capture}
141                {$label|strip_semicolon}:
142             {{/if}}
143             {{* Show the required symbol if field is required, but override not set.  Or show if override is set *}}
144             {{if ($fields[$colData.field.name].required && !isset($colData.field.displayParams.required)) || 
145                  (isset($colData.field.displayParams.required) && $colData.field.displayParams.required)}}
146                 <span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
147             {{/if}}
148         </td>
149         {{/if}}
150         <td valign="top" width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}%' {{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}}>
151         {{if $fields[$colData.field.name] && !empty($colData.field.fields) }}
152             {{foreach from=$colData.field.fields item=subField}}
153                 {{if $fields[$subField.name]}}
154                     {counter name="panelFieldCount" print=false}
155                     {{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$subField.name] displayType='EditView' displayParams=$subField.displayParams formName=$form_name}}&nbsp;
156                 {{/if}}
157             {{/foreach}}
158         {{elseif !empty($colData.field.customCode)}}
159             {counter name="panelFieldCount" print=false}
160             {{php}}$this->_tpl_vars['colData']['field']['displayParams']['idName'] = $this->_tpl_vars['module'] . $this->_tpl_vars['colData']['field']['name'];{{/php}}
161             {{sugar_evalcolumn var=$colData.field.customCode colData=$colData tabindex=$colData.field.tabindex}}
162         {{elseif $fields[$colData.field.name]}}
163             {counter name="panelFieldCount" print=false}
164             {{$colData.displayParams}}
165             {{php}}$this->_tpl_vars['colData']['field']['displayParams']['idName'] = $this->_tpl_vars['module'] . $this->_tpl_vars['colData']['field']['name'];{{/php}}
166             {{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$colData.field.name] displayType='EditView' displayParams=$colData.field.displayParams typeOverride=$colData.field.type formName=$form_name}}
167         {{/if}}
168         </td>
169     {{/foreach}}
170     </tr>
171 {{/foreach}}
172 </table>
173 {{/foreach}}