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