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