2 /*********************************************************************************
3 * SugarCRM is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 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 ********************************************************************************/
38 {{include file=$headerTpl}}
39 {sugar_include include=$includes}
42 <div id="{{$form_name}}_tabs"
48 {* Generate the Tab headers *}
49 {{counter name="tabCount" start=-1 print=false assign="tabCount"}}
51 {{foreach name=section from=$sectionPanels key=label item=panel}}
52 {{counter name="tabCount" print=false}}
53 <li class="selected"><a id="tab{{$tabCount}}" href="#tab{{$tabCount}}"><em>{sugar_translate label='{{$label}}' module='{{$module}}'}</em></a></li>
57 <div {{if $useTabs}}class="yui-content"{{/if}}>
58 {{* Loop through all top level panels first *}}
59 {{counter name="panelCount" start=-1 print=false assign="panelCount"}}
61 {{foreach name=section from=$sectionPanels key=label item=panel}}
62 {{counter name="panelCount" print=false}}
64 {{* Print out the table data *}}
65 {{if $label == 'DEFAULT'}}
66 <div id="Default_{$module}_Subpanel">
71 {counter name="panelFieldCount" start=0 print=false assign="panelFieldCount"}
72 {{* Check to see if the panel variable is an array, if not, we'll attempt an include with type param php *}}
73 {{* See function.sugar_include.php *}}
74 {{if !is_array($panel)}}
75 {sugar_include type='php' file='{{$panel}}'}
78 <table width="100%" border="0" cellspacing="1" cellpadding="0" class="{$def.templateMeta.panelClass|default:'edit view'}">
79 {{* Only show header if it is not default or an int value *}}
80 {{if !empty($label) && !is_int($label) && $label != 'DEFAULT' && !$useTabs && $showSectionPanelsTitles}}
82 <th align="left" colspan="8">
83 <h4>{sugar_translate label='{{$label}}' module='{{$module}}'}</h4>
88 {{assign var='rowCount' value=0}}
89 {{foreach name=rowIteration from=$panel key=row item=rowData}}
92 {{assign var='columnsInRow' value=$rowData|@count}}
93 {{assign var='columnsUsed' value=0}}
95 {{* Loop through each column and display *}}
96 {{counter name="colCount" start=0 print=false assign="colCount"}}
98 {{foreach name=colIteration from=$rowData key=col item=colData}}
100 {{counter name="colCount" print=false}}
101 {{math assign="tabIndex" equation="$panelCount * $maxColumns + $colCount"}}
102 {{if count($rowData) == $colCount}}
103 {{assign var="colCount" value=0}}
107 {{if empty($def.templateMeta.labelsOnTop) && empty($colData.field.hideLabel)}}
108 <td valign="top" id='{{$colData.field.name}}_label' width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' scope="row">
109 {{if isset($colData.field.customLabel)}}
110 {{$colData.field.customLabel}}
111 {{elseif isset($colData.field.label)}}
112 {capture name="label" assign="label"}
113 {sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}
115 {$label|strip_semicolon}:
116 {{elseif isset($fields[$colData.field.name])}}
117 {capture name="label" assign="label"}
118 {sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}
120 {$label|strip_semicolon}:
122 {{* Show the required symbol if field is required, but override not set. Or show if override is set *}}
123 {{if ($fields[$colData.field.name].required && !isset($colData.field.displayParams.required)) ||
124 (isset($colData.field.displayParams.required) && $colData.field.displayParams.required && $fields[$colData.field.name].required !== false)}}
125 <span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
130 <td valign="top" width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}%' {{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}}>
131 {{if !empty($def.templateMeta.labelsOnTop)}}
132 {{if isset($colData.field.label)}}
133 {{if !empty($colData.field.label)}}
134 {sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}:
136 {{elseif isset($fields[$colData.field.name])}}
137 {sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}:
140 {{* Show the required symbol if field is required, but override not set. Or show if override is set *}}
141 {{if ($fields[$colData.field.name].required && (!isset($colData.field.displayParams.required) || $colData.field.displayParams.required)) ||
142 (isset($colData.field.displayParams.required) && $colData.field.displayParams.required)}}
143 <span class="required" title="{{$APP.LBL_REQUIRED_TITLE}}">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
145 {{if !isset($colData.field.label) || !empty($colData.field.label)}}
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"}
155 {{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$subField.name] displayType='EditView' displayParams=$subField.displayParams formName=$form_name}}
158 {{elseif !empty($colData.field.customCode)}}
159 {counter name="panelFieldCount"}
160 {{sugar_evalcolumn var=$colData.field.customCode colData=$colData tabindex=$colData.field.tabindex}}
161 {{elseif $fields[$colData.field.name]}}
162 {counter name="panelFieldCount"}
163 {{$colData.displayParams}}
164 {{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}}
175 {if $panelFieldCount == 0}
177 <script>document.getElementById("{{$label}}").style.display='none';</script>
181 {{include file=$footerTpl}}
183 <script type="text/javascript" src="include/javascript/sugar_grp_yui_widgets.js"></script>
184 <script type="text/javascript">
185 var {{$form_name}}_tabs = new YAHOO.widget.TabView("{{$form_name}}_tabs");
186 {{$form_name}}_tabs.selectTab(0);
189 <script type="text/javascript">
190 YAHOO.util.Event.onContentReady("form_QuickCreate_Accounts",
191 function () {ldelim} initEditView(document.forms.{{$form_name}}) {rdelim});
192 //window.setTimeout(, 100);
193 window.onbeforeunload = function () {ldelim} return onUnloadEditView(); {rdelim};