2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 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 ********************************************************************************/
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}}
45 input[disabled] {ldelim}
46 background-color:lightgray;
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}/>
53 {{if isset($def.templateMeta.form.hidden)}}
54 {{foreach from=$def.templateMeta.form.hidden item=field}}
59 <script type="text/javascript">
60 mod_array.push('{{$module}}');//Bug#50590 add all required modules to mod_array
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}
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}
80 YAHOO.util.Event.onContentReady('create{{$module}}', function(){ldelim}
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();
96 {sugar_translate label='{{$label}}' module='Leads'}
98 {{if !empty($selectRelation)}}
99 {if !empty($def.select)}
100 {sugar_translate label='LNK_SELECT_{{$module|strtoupper}}' module='Leads'}
102 <span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
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'}}
107 if (typeof(sqs_objects) == "undefined") sqs_objects = [];
108 sqs_objects['{{$form_name}}_{$selectFields.{{$module}}}'] = {ldelim}
109 form : '{{$form_name}}',
111 modules : ['{{$module}}'],
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}'],
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}}
129 {{assign var='columnsInRow' value=$rowData|@count}}
130 {{assign var='columnsUsed' value=0}}
132 {{* Loop through each column and display *}}
133 {{counter name="colCount" start=0 print=false assign="colCount"}}
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}}
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}}'}
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}}'}
153 {$label|strip_semicolon}:
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>
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}}
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}}