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