]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/DetailView/DetailView.tpl
Release 6.5.0
[Github/sugarcrm.git] / include / DetailView / DetailView.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 {{include file=$headerTpl}}
39 {sugar_include include=$includes}
40 <div id="{{$module}}_detailview_tabs"
41 {{if $useTabs}}
42 class="yui-navset detailview_tabs"
43 {{/if}}
44 >
45     {{if $useTabs}}
46     {* Generate the Tab headers *}
47     {{counter name="tabCount" start=-1 print=false assign="tabCount"}}
48     <ul class="yui-nav">
49     {{foreach name=section from=$sectionPanels key=label item=panel}}
50         {{counter name="tabCount" print=false}}
51         <li><a id="tab{{$tabCount}}" href="javascript:void(0)"><em>{sugar_translate label='{{$label}}' module='{{$module}}'}</em></a></li>
52     {{/foreach}}
53     </ul>
54     {{/if}}
55     <div {{if $useTabs}}class="yui-content"{{/if}}>
56 {{* Loop through all top level panels first *}}
57 {{counter name="panelCount" print=false start=0 assign="panelCount"}}
58 {{foreach name=section from=$sectionPanels key=label item=panel}}
59 {{assign var='panel_id' value=$panelCount}}
60 <div id='{{$label}}' class='detail view  detail508'>
61 {counter name="panelFieldCount" start=0 print=false assign="panelFieldCount"}
62 {{* Print out the panel title if one exists*}}
63
64 {{* Check to see if the panel variable is an array, if not, we'll attempt an include with type param php *}}
65 {{* See function.sugar_include.php *}}
66 {{if !is_array($panel)}}
67     {sugar_include type='php' file='{{$panel}}'}
68 {{else}}
69
70         {{if !empty($label) && !is_int($label) && $label != 'DEFAULT' && !$useTabs}}
71         <h4>{sugar_translate label='{{$label}}' module='{{$module}}'}</h4>
72         {{/if}}
73         {{* Print out the table data *}}
74         <table id='detailpanel_{{$smarty.foreach.section.iteration}}' cellspacing='{$gridline}'>
75
76
77
78         {{foreach name=rowIteration from=$panel key=row item=rowData}}
79         {counter name="fieldsUsed" start=0 print=false assign="fieldsUsed"}
80         {counter name="fieldsHidden" start=0 print=false assign="fieldsHidden"}
81         {capture name="tr" assign="tableRow"}
82         <tr>
83                 {{assign var='columnsInRow' value=$rowData|@count}}
84                 {{assign var='columnsUsed' value=0}}
85                 {{foreach name=colIteration from=$rowData key=col item=colData}}
86             {{if !empty($colData.field.hideIf)}}
87                 {if !({{$colData.field.hideIf}}) }
88             {{/if}}
89                         {counter name="fieldsUsed"}
90                         {{if empty($colData.field.hideLabel)}}
91                         <td width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' scope="col">
92                                 {{if !empty($colData.field.name)}}
93                                     {if !$fields.{{$colData.field.name}}.hidden}
94                 {{/if}}
95                                 {{if isset($colData.field.customLabel)}}
96                                {{$colData.field.customLabel}}
97                                 {{elseif isset($colData.field.label) && strpos($colData.field.label, '$')}}
98                                    {capture name="label" assign="label"}{{$colData.field.label}}{/capture}
99                                {$label|strip_semicolon}:
100                                 {{elseif isset($colData.field.label)}}
101                                    {capture name="label" assign="label"}{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}{/capture}
102                                {$label|strip_semicolon}:
103                                 {{elseif isset($fields[$colData.field.name])}}
104                                    {capture name="label" assign="label"}{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}{/capture}
105                                {$label|strip_semicolon}:
106                                 {{else}}
107                                    &nbsp;
108                                 {{/if}}
109                 {{if isset($colData.field.popupHelp) || isset($fields[$colData.field.name]) && isset($fields[$colData.field.name].popupHelp) }}
110                    {{if isset($colData.field.popupHelp) }}
111                      {capture name="popupText" assign="popupText"}{sugar_translate label="{{$colData.field.popupHelp}}" module='{{$module}}'}{/capture}
112                    {{elseif isset($fields[$colData.field.name].popupHelp)}}
113                      {capture name="popupText" assign="popupText"}{sugar_translate label="{{$fields[$colData.field.name].popupHelp}}" module='{{$module}}'}{/capture}
114                    {{/if}}
115                    {sugar_help text=$popupText WIDTH=400}
116                 {{/if}}
117                 {{if !empty($colData.field.name)}}
118                 {/if}
119                 {{/if}}
120                 {{/if}}
121                         </td>
122                         <td width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}%' {{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}} {{if isset($fields[$colData.field.name].type) && $fields[$colData.field.name].type == 'phone'}}class="phone"{{/if}}>
123                             {{if !empty($colData.field.name)}}
124                             {if !$fields.{{$colData.field.name}}.hidden}
125                             {{/if}}
126                                 {{$colData.field.prefix}}
127                                 {{if ($colData.field.customCode && !$colData.field.customCodeRenderField) || $colData.field.assign}}
128                                         {counter name="panelFieldCount"}
129                                         <span id="{{$colData.field.name}}" class="sugar_field">{{sugar_evalcolumn var=$colData.field colData=$colData}}</span>
130                                 {{elseif $fields[$colData.field.name] && !empty($colData.field.fields) }}
131                                     {{foreach from=$colData.field.fields item=subField}}
132                                         {{if $fields[$subField]}}
133                                                 {counter name="panelFieldCount"}
134                                             {{sugar_field parentFieldArray='fields' tabindex=$tabIndex vardef=$fields[$subField] displayType='DetailView'}}&nbsp;
135                                         {{else}}
136                                                 {counter name="panelFieldCount"}
137                                             {{$subField}}
138                                         {{/if}}
139                                     {{/foreach}}
140                                 {{elseif $fields[$colData.field.name]}}
141                                         {counter name="panelFieldCount"}
142                                         {{sugar_field parentFieldArray='fields' vardef=$fields[$colData.field.name] displayType='DetailView' displayParams=$colData.field.displayParams typeOverride=$colData.field.type}}
143                                 {{/if}}
144                                 {{if !empty($colData.field.customCode) && $colData.field.customCodeRenderField}}
145                                     {counter name="panelFieldCount"}
146                                     <span id="{{$colData.field.name}}" class="sugar_field">{{sugar_evalcolumn var=$colData.field colData=$colData}}</span>
147                 {{/if}}
148                                 {{$colData.field.suffix}}
149                                 {{if !empty($colData.field.name)}}
150                                 {/if}
151                                 {{/if}}
152                         </td>
153             {{if !empty($colData.field.hideIf)}}
154                         {else}
155
156                         <td>&nbsp;</td><td>&nbsp;</td>
157                         {/if}
158             {{/if}}
159                 {{/foreach}}
160         </tr>
161         {/capture}
162         {if $fieldsUsed > 0 && $fieldsUsed != $fieldsHidden}
163         {$tableRow}
164         {/if}
165         {{/foreach}}
166         </table>
167 {{/if}}
168 </div>
169 {if $panelFieldCount == 0 && !$useTabs}
170
171 <script>document.getElementById("{{$label}}").style.display='none';</script>
172 {/if}
173 {{/foreach}}
174 </div></div>
175 {{include file=$footerTpl}}
176 {{if $useTabs}}
177 <script type='text/javascript' src='{sugar_getjspath file='include/javascript/popup_helper.js'}'></script>
178 <script type="text/javascript" src="{sugar_getjspath file='cache/include/javascript/sugar_grp_yui_widgets.js'}"></script>
179 <script type="text/javascript">
180 var {{$module}}_detailview_tabs = new YAHOO.widget.TabView("{{$module}}_detailview_tabs");
181 {{$module}}_detailview_tabs.selectTab(0);
182 </script>
183 {{/if}}