]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/ModuleBuilder/tpls/listView.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / ModuleBuilder / tpls / listView.tpl
1 {*
2
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38
39
40 *}
41 <form name='edittabs' id='edittabs' method='POST' action='index.php'>
42 {literal}
43 <script>
44 studiotabs.reset();
45 </script>
46 {/literal}
47 <input type='hidden' name='action' value={$action}>
48 <input type='hidden' name='view' value={$view}>
49 <input type='hidden' name='module' value='{$module}'>
50 <input type='hidden' name='subpanel' value='{$subpanel}'>
51 <input type='hidden' name='subpanelLabel' value='{$subpanelLabel}'>
52 <input type='hidden' name='local' value='{$local}'>
53 <input type='hidden' name='view_module' value='{$view_module}'>
54 {if $fromPortal}
55     <input type='hidden' name='PORTAL' value='1'>
56 {/if}
57 <input type='hidden' name='view_package' value='{$view_package}'>
58 <input type='hidden' name='to_pdf' value='1'>
59 <link rel="stylesheet" type="text/css" href="modules/ModuleBuilder/tpls/ListEditor.css"/>
60
61 <table id="editor-content" class="list-editor">
62 <tr><td colspan=3>{$buttons}</td></tr>
63 {if isset($subpanel) && isset($subpanel_label)}
64 <tr>
65     <td colspan=3>
66     <span class='mbLBL'>{sugar_translate label='LBL_SUBPANEL_TITLE'}</span>
67     <input id ="subpanel_title" type="text" name="subpanel_title" value="{$subpanel_title}">
68     <input id ="subpanel_title_key" type="hidden" name="subpanel_title_key" value="{$subpanel_label}">
69     </td>
70 </tr>
71 {/if}
72 <tr>
73
74 {counter start=0 name="groupCounter" print=false assign="groupCounter"}
75 {foreach from=$groups key='label' item='list'}
76     {counter name="groupCounter"}
77 {/foreach}
78 {math assign="groupWidth" equation="100/$groupCounter-3"}
79
80 {counter start=0 name="slotCounter" print=false assign="slotCounter"}
81 {counter start=0 name="modCounter" print=false assign="modCounter"}
82
83 {foreach from=$groups key='label' item='list'}
84
85 <td id={$label}  width="30%" VALIGN="top" style="float: left; border: 1px gray solid; padding:4px; margin-right:4px; margin-top: 8px;  overflow-x: hidden;">
86 <h3 >{$label}</h3>
87 <ul id='ul{$slotCounter}' style="overflow-y: auto; overflow-x: hidden;">
88
89 {foreach from=$list key='key' item='value'}
90
91 <li name="width={$value.width}%" id='subslot{$modCounter}' class='draggable' >
92     <table width='100%'>
93         <tr>
94             <td id='subslot{$modCounter}label' style="font-weight: bold;">
95             {if $MB}
96             {if !empty($value.label)}{$current_mod_strings[$value.label]}{elseif !empty($value.vname)}{$current_mod_strings[$value.vname]}{else}{$key}{/if}
97             {else}
98             {if !empty($value.label)}{sugar_translate label=$value.label module=$language}{elseif !empty($value.vname)}{sugar_translate label=$value.vname module=$language}{else}{$key}{/if}
99             {/if}
100             </td>
101             <td></td>
102             <td align="right" class="editIcon">
103                 {* BEGIN SUGARCRM flav=pro ONLY *}
104                 {if isset($field_defs.$key.calculated) && $field_defs.$key.calculated}
105                     {sugar_getimage name="SugarLogic/icon_calculated" alt=$mod_strings.LBL_CALCULATED ext=".png" other_attributes=''}
106                 {/if}
107                 {if isset($field_defs.$key.dependency) && $field_defs.$key.dependency}
108                     {sugar_getimage name="SugarLogic/icon_dependent" alt=$mod_strings.LBL_DEPENDANT ext=".png" other_attributes=''}
109                 {/if}
110                 {* END SUGARCRM flav=pro ONLY *}
111                 <img src="{sugar_getimagepath file='edit_inline.gif'}" style="cursor: pointer;"
112                                 onclick="var value_label = document.getElementById('subslot{$modCounter}label').innerHTML.replace(/^\s+|\s+$/g,''); 
113                                     {if !($view|substr:-6 == "search") }
114                                         var value_width = document.getElementById('subslot{$modCounter}width').innerHTML;
115                                         {/if}
116                                         ModuleBuilder.getContent('module=ModuleBuilder&action=editProperty&view_module={$view_module|escape:'url'}'+
117                                                         '{if isset($subpanel)}&subpanel={$subpanel|escape:'url'}{/if}'+
118                                                         '{if $MB}&MB={$MB|escape:'url'}&view_package={$view_package|escape:'url'}{/if}'+
119                                                         '&id_label=subslot{$modCounter}label'+
120                                                         '&name_label=label_'+
121                                                           '{if isset($value.label)}{$value.label|escape:'url'}'+
122                                                           '{elseif !empty($value.vname)}{$value.vname|escape:'url'}'+
123                                                           '{else}{$key|escape:'url'}{/if}'+
124                                                         '&title_label={$MOD.LBL_LABEL_TITLE}&value_label=' + encodeURIComponent(value_label)
125                                                         {if ($view|substr:-6 != "search") }
126                                                         + '&id_width=subslot{$modCounter}width&name_width={$MOD.LBL_WIDTH|escape:'url'}&value_width=' + encodeURIComponent(value_width)
127                                                         {/if}
128                                         );"
129                                 >
130             </td>
131             </tr>
132             <tr class='fieldValue'>
133                 {if empty($hideKeys)}<td>[{$key}]</td>{/if}
134                 <td align="right" colspan="2" class="percentage">
135                                         {if $view|substr:-6 == "search" }
136                                         <span style="display:none" id='subslot{$modCounter}width'>{$value.width}</span> <span style="display:none">%</span>
137                                         {else}
138                                         <span id='subslot{$modCounter}width'>{$value.width}</span> <span>%</span>
139                                         {/if}
140                                 </td>
141         </tr>
142     </table>
143 </li>
144
145 <script>
146 studiotabs.tabLabelToValue['{$value.label}|{$key}'] = '{$key}';
147 if(typeof(studiotabs.subtabModules['subslot{$modCounter}']) == 'undefined')studiotabs.subtabModules['subslot{$modCounter}'] = '{$value.label}|{$key}';
148 </script>
149
150 {counter name="modCounter"}
151 {/foreach}
152
153 <li id='topslot{$slotCounter}' class='noBullet'>&nbsp;</li>
154
155 </ul>
156 </td>
157
158 {counter name="slotCounter"}
159 {/foreach}
160 </td>
161 </tr></table>
162
163 <script>
164
165 {literal}
166 function dragDropInit(){
167     studiotabs.fields = {};
168     studiotabs.slotCount = {/literal}{$slotCounter};
169     studiotabs.modCount = {$modCounter};
170     {literal}
171     for(msi = 0; msi < studiotabs.slotCount ; msi++){
172         studiotabs.fields["topslot"+ msi] = new Studio2.ListDD("topslot" + msi, "subTabs", true);
173     }
174     for(msi = 0; msi < studiotabs.modCount ; msi++){
175             studiotabs.fields["subslot"+ msi] = new Studio2.ListDD("subslot" + msi, "subTabs", false);
176     }
177
178     studiotabs.fields["subslot"+ (msi - 1) ].updateTabs();
179 };
180
181 resizeDDLists = function() {
182         var Dom = YAHOO.util.Dom;
183         if (!Dom.get('ul0'))
184             return;
185     var body = document.getElementById('mbtabs');
186     for(var msi = 0; msi < studiotabs.slotCount ; msi++){
187         var targetHeight =  body.offsetHeight - (Dom.getY("ul" + msi) - Dom.getY(body)) - 20;
188         if (SUGAR.isIE) {
189             targetHeight -= 10;
190         }
191
192         if (targetHeight > 0 )
193                 Dom.setStyle("ul" + msi, "height", targetHeight + "px");
194     }
195         Studio2.scrollZones = {}
196         for (var i = 0; Dom.get("ul" + i); i++){
197                 Studio2.scrollZones["ul" + i] = Studio2.getScrollZones("ul" + i);
198         }
199 };
200
201 function countListFields() {
202         var count = 0;
203         var divs = document.getElementById( 'ul0' ).getElementsByTagName( 'li' ) ;              
204         for ( var j=0;j<divs.length;j++) {
205                 if (divs[j].className == 'draggable') count++;
206         }
207         return count;
208 };
209
210 {/literal}
211 dragDropInit();
212 setTimeout(resizeDDLists, 100);
213 ModuleBuilder.helpRegister('edittabs');
214 ModuleBuilder.helpRegisterByID('content', 'div');
215
216 ModuleBuilder.helpSetup('{$helpName}', '{$helpDefault}');
217 if('{$from_mb}')
218     ModuleBuilder.helpUnregisterByID('savebtn');
219 ModuleBuilder.MBpackage = '{$view_package}';
220 </script>
221
222
223
224 <div id='logDiv' style='display:none'>
225 </div>
226
227 {$additionalFormData}
228
229 </form>
230
231